Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,9 +14,7 @@ def format_gemini_response(text):
|
|
| 14 |
|
| 15 |
bold_pattern = r"\*\*(.*?)\*\*"
|
| 16 |
italic_pattern = r"\*(.*?)\*"
|
| 17 |
-
code_pattern = r"
|
| 18 |
-
(.*?)
|
| 19 |
-
"
|
| 20 |
text = text.replace('\n', '<br>')
|
| 21 |
formatted_text = re.sub(code_pattern,"<pre><code>\\1</code></pre>",text)
|
| 22 |
formatted_text = re.sub(bold_pattern, "<b>\\1</b>", formatted_text)
|
|
@@ -37,4 +35,4 @@ def predict(message :str , chat_his ,d ) -> str:
|
|
| 37 |
response = chat.send_message(message)
|
| 38 |
return format_gemini_response(response.text),chat_his, d
|
| 39 |
iface = gr.Interface(fn = predict,inputs = ["text","list","json"],outputs = "text")
|
| 40 |
-
iface.launch()
|
|
|
|
| 14 |
|
| 15 |
bold_pattern = r"\*\*(.*?)\*\*"
|
| 16 |
italic_pattern = r"\*(.*?)\*"
|
| 17 |
+
code_pattern = r"(.*?)"
|
|
|
|
|
|
|
| 18 |
text = text.replace('\n', '<br>')
|
| 19 |
formatted_text = re.sub(code_pattern,"<pre><code>\\1</code></pre>",text)
|
| 20 |
formatted_text = re.sub(bold_pattern, "<b>\\1</b>", formatted_text)
|
|
|
|
| 35 |
response = chat.send_message(message)
|
| 36 |
return format_gemini_response(response.text),chat_his, d
|
| 37 |
iface = gr.Interface(fn = predict,inputs = ["text","list","json"],outputs = "text")
|
| 38 |
+
iface.launch(debug = True)
|