Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,8 @@ from transformers import AutoModelForCausalLM
|
|
| 14 |
from transformers import AutoTokenizer
|
| 15 |
import time
|
| 16 |
|
|
|
|
|
|
|
| 17 |
EXAMPLE_PROMPT = """This is a tool for helping someone with memory issues remember the next word.
|
| 18 |
The predictions follow a few rules:
|
| 19 |
1) The predictions are suggestions of ways to continue the transcript as if someone forgot what the next word was.
|
|
@@ -72,14 +74,15 @@ def inference(audio, prompt, model, temperature, latest):
|
|
| 72 |
#print("Infered type is: ", type(infered))
|
| 73 |
infers = list(map(lambda x: x.replace("\n", ""), temp))
|
| 74 |
#infered = list(map(lambda x: x.split(','), infers))
|
|
|
|
| 75 |
|
| 76 |
|
| 77 |
-
return transcript, infers,
|
| 78 |
|
| 79 |
|
| 80 |
# get audio from microphone
|
| 81 |
with gr.Blocks() as face:
|
| 82 |
-
|
| 83 |
with gr.Row():
|
| 84 |
with gr.Column():
|
| 85 |
audio = gr.Audio(source="microphone", type="filepath")
|
|
|
|
| 14 |
from transformers import AutoTokenizer
|
| 15 |
import time
|
| 16 |
|
| 17 |
+
convoState = gr.State([""])
|
| 18 |
+
|
| 19 |
EXAMPLE_PROMPT = """This is a tool for helping someone with memory issues remember the next word.
|
| 20 |
The predictions follow a few rules:
|
| 21 |
1) The predictions are suggestions of ways to continue the transcript as if someone forgot what the next word was.
|
|
|
|
| 74 |
#print("Infered type is: ", type(infered))
|
| 75 |
infers = list(map(lambda x: x.replace("\n", ""), temp))
|
| 76 |
#infered = list(map(lambda x: x.split(','), infers))
|
| 77 |
+
convoState: latest
|
| 78 |
|
| 79 |
|
| 80 |
+
return transcript, infers, convoState
|
| 81 |
|
| 82 |
|
| 83 |
# get audio from microphone
|
| 84 |
with gr.Blocks() as face:
|
| 85 |
+
|
| 86 |
with gr.Row():
|
| 87 |
with gr.Column():
|
| 88 |
audio = gr.Audio(source="microphone", type="filepath")
|