Spaces:
Runtime error
Runtime error
Julian Vanecek commited on
Commit ·
605a57e
1
Parent(s): 2edbf88
reverting frontend
Browse files
app.py
CHANGED
|
@@ -53,7 +53,8 @@ def process_faq(question, user_id="anonymous", model="claude-sonnet"):
|
|
| 53 |
if i % 2 == 0 or i == len(words) - 1: # Yield every 2 words or at the end
|
| 54 |
yield current_text.strip()
|
| 55 |
|
| 56 |
-
|
|
|
|
| 57 |
|
| 58 |
except Exception as e:
|
| 59 |
return f"Error processing FAQ: {str(e)}"
|
|
@@ -78,7 +79,7 @@ with gr.Blocks() as demo:
|
|
| 78 |
# Generate random user ID for this session
|
| 79 |
session_user_id = str(uuid.uuid4())[:8]
|
| 80 |
faq_button = gc.Button("Process")
|
| 81 |
-
faq_output = gc.
|
| 82 |
with gr.Row(): # type: ignore
|
| 83 |
thumbs_down = gc.Button("Report bad response", elem_id="thumbs-down", interactive=True)
|
| 84 |
feedback_msg = gc.Markdown(visible=False)
|
|
|
|
| 53 |
if i % 2 == 0 or i == len(words) - 1: # Yield every 2 words or at the end
|
| 54 |
yield current_text.strip()
|
| 55 |
|
| 56 |
+
# Convert literal \n to actual line breaks
|
| 57 |
+
return full_response.replace('\\n', '\n')
|
| 58 |
|
| 59 |
except Exception as e:
|
| 60 |
return f"Error processing FAQ: {str(e)}"
|
|
|
|
| 79 |
# Generate random user ID for this session
|
| 80 |
session_user_id = str(uuid.uuid4())[:8]
|
| 81 |
faq_button = gc.Button("Process")
|
| 82 |
+
faq_output = gc.Textbox(label="Response", lines=10)
|
| 83 |
with gr.Row(): # type: ignore
|
| 84 |
thumbs_down = gc.Button("Report bad response", elem_id="thumbs-down", interactive=True)
|
| 85 |
feedback_msg = gc.Markdown(visible=False)
|