Spaces:
Running
on
Zero
Running
on
Zero
Update src/model.py
Browse files- src/model.py +7 -6
src/model.py
CHANGED
|
@@ -52,14 +52,15 @@ def describe_video(video, question):
|
|
| 52 |
msgs=msgs,
|
| 53 |
tokenizer=tokenizer,
|
| 54 |
sampling=True,
|
| 55 |
-
temperature=0.7,
|
| 56 |
stream=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
system_prompt="You are an AI assistant specialized in visual content analysis. Given a video and a related question, analyze the video thoroughly and provide a precise and informative answer based on the visible content. Ensure your response is clear, accurate, and directly addresses the question.",
|
| 58 |
**params
|
| 59 |
)
|
| 60 |
|
| 61 |
-
#
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
# Return the full answer as a string
|
| 65 |
-
return full_answer
|
|
|
|
| 52 |
msgs=msgs,
|
| 53 |
tokenizer=tokenizer,
|
| 54 |
sampling=True,
|
|
|
|
| 55 |
stream=True,
|
| 56 |
+
top_p=0.8,
|
| 57 |
+
top_k=100,
|
| 58 |
+
temperature=0.7,
|
| 59 |
+
repetition_penalty=1.05,
|
| 60 |
+
max_new_tokens=2048,
|
| 61 |
system_prompt="You are an AI assistant specialized in visual content analysis. Given a video and a related question, analyze the video thoroughly and provide a precise and informative answer based on the visible content. Ensure your response is clear, accurate, and directly addresses the question.",
|
| 62 |
**params
|
| 63 |
)
|
| 64 |
|
| 65 |
+
# Return the answer
|
| 66 |
+
return "".join(answer)
|
|
|
|
|
|
|
|
|