File size: 751 Bytes
6a56fbb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from transformers import pipeline

# Load your model from Hugging Face Hub
pipe = pipeline("text-classification", model="rbarac/open-rotor-copilot")  # Or your exact model/task

def analyze_text_input(input_str):
    # Input_str could be: "gyro_std=123.4, vbat_drop=0.91, ..." etc.
    result = pipe(input_str)
    return result[0]["label"]

iface = gr.Interface(
    fn=analyze_text_input,
    inputs=gr.Textbox(label="Feature string", placeholder="gyro_std=123.4, vbat_drop=0.91, ..."),
    outputs=gr.Textbox(label="Detected Issue / Reason"),
    title="Open Rotor Copilot (Single Example)",
    description="Paste a windowed feature string and get detected issue & explanation."
)

if __name__ == "__main__":
    iface.launch()