Spaces:
Runtime error
Runtime error
Leonardo
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -198,17 +198,6 @@ class ModelManager:
|
|
| 198 |
elif chosen_inference == "litellm":
|
| 199 |
return LiteLLMModel(model_id=model_id)
|
| 200 |
|
| 201 |
-
elif chosen_inference == "ollama":
|
| 202 |
-
if not key_manager:
|
| 203 |
-
raise ValueError("Key manager required for Ollama model")
|
| 204 |
-
|
| 205 |
-
return LiteLLMModel(
|
| 206 |
-
model_id=model_id,
|
| 207 |
-
api_base="http://localhost:11434",
|
| 208 |
-
api_key=key_manager.get_key("ollama_api_key"),
|
| 209 |
-
num_ctx=8192,
|
| 210 |
-
)
|
| 211 |
-
|
| 212 |
elif chosen_inference == "openai":
|
| 213 |
if not key_manager:
|
| 214 |
raise ValueError("Key manager required for OpenAI model")
|
|
@@ -397,6 +386,8 @@ class GradioUI:
|
|
| 397 |
"application/pdf",
|
| 398 |
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
| 399 |
"text/plain",
|
|
|
|
|
|
|
| 400 |
],
|
| 401 |
):
|
| 402 |
"""Handle file uploads with proper validation and security."""
|
|
@@ -685,4 +676,3 @@ def main():
|
|
| 685 |
|
| 686 |
if __name__ == "__main__":
|
| 687 |
main()
|
| 688 |
-
|
|
|
|
| 198 |
elif chosen_inference == "litellm":
|
| 199 |
return LiteLLMModel(model_id=model_id)
|
| 200 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 201 |
elif chosen_inference == "openai":
|
| 202 |
if not key_manager:
|
| 203 |
raise ValueError("Key manager required for OpenAI model")
|
|
|
|
| 386 |
"application/pdf",
|
| 387 |
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
| 388 |
"text/plain",
|
| 389 |
+
"image/png", # Add PNG MIME type
|
| 390 |
+
"video/mp4", # Add MP4 MIME type"
|
| 391 |
],
|
| 392 |
):
|
| 393 |
"""Handle file uploads with proper validation and security."""
|
|
|
|
| 676 |
|
| 677 |
if __name__ == "__main__":
|
| 678 |
main()
|
|
|