Spaces:
Runtime error
Runtime error
fix error
Browse files
app.py
CHANGED
|
@@ -4,6 +4,7 @@ import logging
|
|
| 4 |
import os
|
| 5 |
import re
|
| 6 |
import string
|
|
|
|
| 7 |
|
| 8 |
import gradio as gr
|
| 9 |
import requests
|
|
@@ -118,6 +119,7 @@ def scisearch(query, language, num_results=10):
|
|
| 118 |
highlight_terms = payload["highlight_terms"]
|
| 119 |
|
| 120 |
if language == "detect_language":
|
|
|
|
| 121 |
return (
|
| 122 |
(
|
| 123 |
f"""<p style='font-family: Arial; color:MediumAquaMarine; text-align: center; line-height: 3em'>
|
|
@@ -146,6 +148,7 @@ def scisearch(query, language, num_results=10):
|
|
| 146 |
results_html += collapsible_results
|
| 147 |
return results_html
|
| 148 |
|
|
|
|
| 149 |
return process_results(results, highlight_terms)
|
| 150 |
|
| 151 |
except Exception as e:
|
|
@@ -156,6 +159,8 @@ def scisearch(query, language, num_results=10):
|
|
| 156 |
Check if a relevant discussion already exists in the Community tab. If not, please open a discussion.
|
| 157 |
</p>
|
| 158 |
"""
|
|
|
|
|
|
|
| 159 |
|
| 160 |
return results_html
|
| 161 |
|
|
|
|
| 4 |
import os
|
| 5 |
import re
|
| 6 |
import string
|
| 7 |
+
import traceback
|
| 8 |
|
| 9 |
import gradio as gr
|
| 10 |
import requests
|
|
|
|
| 119 |
highlight_terms = payload["highlight_terms"]
|
| 120 |
|
| 121 |
if language == "detect_language":
|
| 122 |
+
results = list(results.values())[0]
|
| 123 |
return (
|
| 124 |
(
|
| 125 |
f"""<p style='font-family: Arial; color:MediumAquaMarine; text-align: center; line-height: 3em'>
|
|
|
|
| 148 |
results_html += collapsible_results
|
| 149 |
return results_html
|
| 150 |
|
| 151 |
+
results = list(results.values())[0]
|
| 152 |
return process_results(results, highlight_terms)
|
| 153 |
|
| 154 |
except Exception as e:
|
|
|
|
| 159 |
Check if a relevant discussion already exists in the Community tab. If not, please open a discussion.
|
| 160 |
</p>
|
| 161 |
"""
|
| 162 |
+
print(e)
|
| 163 |
+
print(traceback.format_exc())
|
| 164 |
|
| 165 |
return results_html
|
| 166 |
|