Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -71,7 +71,19 @@ def synthesize(article_url,progress_audio=gr.Progress()):
|
|
| 71 |
}
|
| 72 |
"""
|
| 73 |
chat = []
|
| 74 |
-
chat.append(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
messages = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
| 76 |
model_inputs = tok([messages], return_tensors="pt").to(device)
|
| 77 |
streamer = TextIteratorStreamer(
|
|
|
|
| 71 |
}
|
| 72 |
"""
|
| 73 |
chat = []
|
| 74 |
+
chat.append(
|
| 75 |
+
{
|
| 76 |
+
"role": "user",
|
| 77 |
+
"content": """{text} \n Convert the text as Elaborate Conversation between two people as Podcast.\nfollowing this template:
|
| 78 |
+
{
|
| 79 |
+
"conversation": [
|
| 80 |
+
{"speaker": "", "text": ""},
|
| 81 |
+
{"speaker": "", "text": ""}
|
| 82 |
+
]
|
| 83 |
+
}""",
|
| 84 |
+
}
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
messages = tok.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
|
| 88 |
model_inputs = tok([messages], return_tensors="pt").to(device)
|
| 89 |
streamer = TextIteratorStreamer(
|