rbarac commited on
Commit
6a56fbb
·
verified ·
1 Parent(s): a8e5cc1

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ # Load your model from Hugging Face Hub
5
+ pipe = pipeline("text-classification", model="rbarac/open-rotor-copilot") # Or your exact model/task
6
+
7
+ def analyze_text_input(input_str):
8
+ # Input_str could be: "gyro_std=123.4, vbat_drop=0.91, ..." etc.
9
+ result = pipe(input_str)
10
+ return result[0]["label"]
11
+
12
+ iface = gr.Interface(
13
+ fn=analyze_text_input,
14
+ inputs=gr.Textbox(label="Feature string", placeholder="gyro_std=123.4, vbat_drop=0.91, ..."),
15
+ outputs=gr.Textbox(label="Detected Issue / Reason"),
16
+ title="Open Rotor Copilot (Single Example)",
17
+ description="Paste a windowed feature string and get detected issue & explanation."
18
+ )
19
+
20
+ if __name__ == "__main__":
21
+ iface.launch()