Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,7 +1,6 @@
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
from gtts import gTTS
|
4 |
-
import IPython.display as ipd
|
5 |
|
6 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
7 |
system_prompt = "Tu nombre es Xaman 3.0"
|
@@ -27,11 +26,11 @@ def text_to_speech(text):
|
|
27 |
tts.save('output.mp3')
|
28 |
return 'output.mp3'
|
29 |
|
30 |
-
|
31 |
-
prompt, history, temperature=
|
32 |
):
|
33 |
global system_prompt_sent
|
34 |
-
temperature = float(temperature)
|
35 |
if temperature < 1e-2:
|
36 |
temperature = 1e-2
|
37 |
top_p = float(top_p)
|
@@ -55,9 +54,7 @@ def generate(
|
|
55 |
yield output
|
56 |
|
57 |
audio_file = text_to_speech(output)
|
58 |
-
|
59 |
-
|
60 |
-
return output
|
61 |
|
62 |
additional_inputs = [
|
63 |
gr.Audio(autoplay=True)
|
|
|
1 |
from huggingface_hub import InferenceClient
|
2 |
import gradio as gr
|
3 |
from gtts import gTTS
|
|
|
4 |
|
5 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
6 |
system_prompt = "Tu nombre es Xaman 3.0"
|
|
|
26 |
tts.save('output.mp3')
|
27 |
return 'output.mp3'
|
28 |
|
29 |
+
ddef generate(
|
30 |
+
prompt, history, temperature=None, max_new_tokens=2048, top_p=0.95, repetition_penalty=1.0,
|
31 |
):
|
32 |
global system_prompt_sent
|
33 |
+
temperature = float(temperature) if temperature is not None else 0.9
|
34 |
if temperature < 1e-2:
|
35 |
temperature = 1e-2
|
36 |
top_p = float(top_p)
|
|
|
54 |
yield output
|
55 |
|
56 |
audio_file = text_to_speech(output)
|
57 |
+
return audio_file
|
|
|
|
|
58 |
|
59 |
additional_inputs = [
|
60 |
gr.Audio(autoplay=True)
|