Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,7 @@ if not read_token:
|
|
15 |
login(read_token)
|
16 |
|
17 |
# Define a dictionary of conversational models
|
|
|
18 |
conversational_models = {
|
19 |
"Qwen": "Qwen/QwQ-32B",
|
20 |
"DeepSeek R1": "deepseek-ai/DeepSeek-R1",
|
@@ -47,12 +48,12 @@ text_to_image_pipelines = {}
|
|
47 |
text_to_speech_pipelines = {}
|
48 |
|
49 |
# Initialize pipelines for other tasks
|
50 |
-
visual_qa_pipeline = pipeline("visual-question-answering", model="dandelin/vilt-b32-finetuned-vqa"
|
51 |
-
document_qa_pipeline = pipeline("question-answering", model="deepset/roberta-base-squad2"
|
52 |
-
image_classification_pipeline = pipeline("image-classification", model="facebook/deit-base-distilled-patch16-224"
|
53 |
-
object_detection_pipeline = pipeline("object-detection", model="facebook/detr-resnet-50"
|
54 |
-
video_classification_pipeline = pipeline("video-classification", model="facebook/timesformer-base-finetuned-k400"
|
55 |
-
summarization_pipeline = pipeline("summarization", model="facebook/bart-large-cnn"
|
56 |
|
57 |
# Use a different model for text-to-audio if stabilityai/stable-audio-open-1.0 is not supported
|
58 |
try:
|
@@ -60,9 +61,10 @@ try:
|
|
60 |
except ValueError as e:
|
61 |
print(f"Error loading stabilityai/stable-audio-open-1.0: {e}")
|
62 |
print("Falling back to a different text-to-audio model.")
|
63 |
-
text_to_audio_pipeline = pipeline("text-to-audio", model="microsoft/speecht5_tts"
|
|
|
|
|
64 |
|
65 |
-
audio_classification_pipeline = pipeline("audio-classification", model="facebook/wav2vec2-base", use_auth_token=read_token)
|
66 |
|
67 |
def load_conversational_model(model_name):
|
68 |
if model_name not in conversational_models_loaded:
|
|
|
15 |
login(read_token)
|
16 |
|
17 |
# Define a dictionary of conversational models
|
18 |
+
|
19 |
conversational_models = {
|
20 |
"Qwen": "Qwen/QwQ-32B",
|
21 |
"DeepSeek R1": "deepseek-ai/DeepSeek-R1",
|
|
|
48 |
text_to_speech_pipelines = {}
|
49 |
|
50 |
# Initialize pipelines for other tasks
|
51 |
+
visual_qa_pipeline = pipeline("visual-question-answering", model="dandelin/vilt-b32-finetuned-vqa")
|
52 |
+
document_qa_pipeline = pipeline("question-answering", model="deepset/roberta-base-squad2")
|
53 |
+
image_classification_pipeline = pipeline("image-classification", model="facebook/deit-base-distilled-patch16-224")
|
54 |
+
object_detection_pipeline = pipeline("object-detection", model="facebook/detr-resnet-50")
|
55 |
+
video_classification_pipeline = pipeline("video-classification", model="facebook/timesformer-base-finetuned-k400")
|
56 |
+
summarization_pipeline = pipeline("summarization", model="facebook/bart-large-cnn")
|
57 |
|
58 |
# Use a different model for text-to-audio if stabilityai/stable-audio-open-1.0 is not supported
|
59 |
try:
|
|
|
61 |
except ValueError as e:
|
62 |
print(f"Error loading stabilityai/stable-audio-open-1.0: {e}")
|
63 |
print("Falling back to a different text-to-audio model.")
|
64 |
+
text_to_audio_pipeline = pipeline("text-to-audio", model="microsoft/speecht5_tts")
|
65 |
+
|
66 |
+
audio_classification_pipeline = pipeline("audio-classification", model="facebook/wav2vec2-base")
|
67 |
|
|
|
68 |
|
69 |
def load_conversational_model(model_name):
|
70 |
if model_name not in conversational_models_loaded:
|