Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -19,7 +19,8 @@ proc_model_name = "microsoft/Phi-3-mini-4k-instruct"
|
|
19 |
proc_model = AutoModelForCausalLM.from_pretrained(
|
20 |
proc_model_name,
|
21 |
torch_dtype=torch.float16,
|
22 |
-
|
|
|
23 |
low_cpu_mem_usage=True,
|
24 |
)
|
25 |
|
@@ -133,10 +134,11 @@ def CanaryPhiVits(user_voice):
|
|
133 |
print(user_input)
|
134 |
response = generate_response(user_input)
|
135 |
print(response)
|
|
|
|
|
|
|
136 |
chatty_response = text_to_speech(response)
|
137 |
|
138 |
-
if chatty_response.startswith(user_input):
|
139 |
-
chatty_response = chatty_response.replace(user_input, '', 1)
|
140 |
|
141 |
return chatty_response
|
142 |
|
|
|
19 |
proc_model = AutoModelForCausalLM.from_pretrained(
|
20 |
proc_model_name,
|
21 |
torch_dtype=torch.float16,
|
22 |
+
revision=653ee820c4f2ee66427e997b4a8ca3e9323e7d46,
|
23 |
+
trust_remote_code=True,
|
24 |
low_cpu_mem_usage=True,
|
25 |
)
|
26 |
|
|
|
134 |
print(user_input)
|
135 |
response = generate_response(user_input)
|
136 |
print(response)
|
137 |
+
if response.startswith(user_input):
|
138 |
+
response = chatty_response.replace(user_input, '', 1)
|
139 |
+
print(response)
|
140 |
chatty_response = text_to_speech(response)
|
141 |
|
|
|
|
|
142 |
|
143 |
return chatty_response
|
144 |
|