Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -127,17 +127,17 @@ def inference(video, step_number):
|
|
| 127 |
with open(video_path, "rb") as f:
|
| 128 |
video_data = f.read()
|
| 129 |
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
|
| 142 |
# Gradio Interface
|
| 143 |
def create_interface():
|
|
|
|
| 127 |
with open(video_path, "rb") as f:
|
| 128 |
video_data = f.read()
|
| 129 |
|
| 130 |
+
# Get possible reasons for the selected step
|
| 131 |
+
possible_reasons = DELAY_REASONS[step_number]
|
| 132 |
+
|
| 133 |
+
# Generate the analysis prompt
|
| 134 |
+
prompt = get_analysis_prompt(step_number, possible_reasons)
|
| 135 |
+
|
| 136 |
+
# Get model prediction
|
| 137 |
+
temperature = 0.8
|
| 138 |
+
response = predict(prompt, video_data, temperature, model, tokenizer)
|
| 139 |
+
|
| 140 |
+
return response
|
| 141 |
|
| 142 |
# Gradio Interface
|
| 143 |
def create_interface():
|