Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,7 +56,10 @@ def generate(
|
|
| 56 |
top_k: int = 50,
|
| 57 |
repetition_penalty: float = 1.2,
|
| 58 |
) -> Iterator[str]:
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
| 60 |
conversation = []
|
| 61 |
if system_prompt:
|
| 62 |
conversation.append({"role": "system", "content": system_prompt})
|
|
@@ -98,6 +101,7 @@ def generate(
|
|
| 98 |
for text in streamer:
|
| 99 |
outputs.append(text)
|
| 100 |
yield "".join(outputs)
|
|
|
|
| 101 |
|
| 102 |
# Gradio Interface Setup
|
| 103 |
chat_interface = gr.ChatInterface(
|
|
|
|
| 56 |
top_k: int = 50,
|
| 57 |
repetition_penalty: float = 1.2,
|
| 58 |
) -> Iterator[str]:
|
| 59 |
+
if chat_history is None:
|
| 60 |
+
logging.error("chat_history is None, initializing to empty list.")
|
| 61 |
+
chat_history = [] # Initialize to an empty list if None is passed
|
| 62 |
+
|
| 63 |
conversation = []
|
| 64 |
if system_prompt:
|
| 65 |
conversation.append({"role": "system", "content": system_prompt})
|
|
|
|
| 101 |
for text in streamer:
|
| 102 |
outputs.append(text)
|
| 103 |
yield "".join(outputs)
|
| 104 |
+
logging.basicConfig(level=logging.DEBUG)
|
| 105 |
|
| 106 |
# Gradio Interface Setup
|
| 107 |
chat_interface = gr.ChatInterface(
|