Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -102,7 +102,7 @@ QUANTIZATION = str(os.environ.get("QUANTIZATION", ""))
|
|
| 102 |
|
| 103 |
# Batch inference file upload
|
| 104 |
ENABLE_BATCH_INFER = bool(int(os.environ.get("ENABLE_BATCH_INFER", "1")))
|
| 105 |
-
BATCH_INFER_MAX_ITEMS = int(os.environ.get("BATCH_INFER_MAX_ITEMS", "
|
| 106 |
BATCH_INFER_MAX_FILE_SIZE = int(os.environ.get("BATCH_INFER_MAX_FILE_SIZE", "500"))
|
| 107 |
BATCH_INFER_MAX_PROMPT_TOKENS = int(os.environ.get("BATCH_INFER_MAX_PROMPT_TOKENS", "4000"))
|
| 108 |
BATCH_INFER_SAVE_TMP_FILE = os.environ.get("BATCH_INFER_SAVE_TMP_FILE", "./tmp/pred.json")
|
|
@@ -249,7 +249,7 @@ MODEL_TITLE = """
|
|
| 249 |
|
| 250 |
MODEL_DESC = f"""
|
| 251 |
<div style='display:flex; gap: 0.25rem; '>
|
| 252 |
-
<a href='https://github.com/
|
| 253 |
<a href='https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue'></a>
|
| 254 |
<a href='https://huggingface.co/SeaLLMs/SeaLLM-Chat-13b'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-blue'></a>
|
| 255 |
<a href='https://arxiv.org/pdf/2312.00738.pdf'><img src='https://img.shields.io/badge/Paper-PDF-red'></a>
|
|
@@ -1143,7 +1143,7 @@ def _detect_lang(text):
|
|
| 1143 |
try:
|
| 1144 |
dlang = detect_lang(text)
|
| 1145 |
except Exception as e:
|
| 1146 |
-
print(f'Error: {e}')
|
| 1147 |
if "No features in text." in str(e):
|
| 1148 |
return "en"
|
| 1149 |
else:
|
|
|
|
| 102 |
|
| 103 |
# Batch inference file upload
|
| 104 |
ENABLE_BATCH_INFER = bool(int(os.environ.get("ENABLE_BATCH_INFER", "1")))
|
| 105 |
+
BATCH_INFER_MAX_ITEMS = int(os.environ.get("BATCH_INFER_MAX_ITEMS", "100"))
|
| 106 |
BATCH_INFER_MAX_FILE_SIZE = int(os.environ.get("BATCH_INFER_MAX_FILE_SIZE", "500"))
|
| 107 |
BATCH_INFER_MAX_PROMPT_TOKENS = int(os.environ.get("BATCH_INFER_MAX_PROMPT_TOKENS", "4000"))
|
| 108 |
BATCH_INFER_SAVE_TMP_FILE = os.environ.get("BATCH_INFER_SAVE_TMP_FILE", "./tmp/pred.json")
|
|
|
|
| 249 |
|
| 250 |
MODEL_DESC = f"""
|
| 251 |
<div style='display:flex; gap: 0.25rem; '>
|
| 252 |
+
<a href='https://github.com/damo-nlp-sg/seallms'><img src='https://img.shields.io/badge/Github-Code-success'></a>
|
| 253 |
<a href='https://huggingface.co/spaces/SeaLLMs/SeaLLM-Chat-13b'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Spaces-blue'></a>
|
| 254 |
<a href='https://huggingface.co/SeaLLMs/SeaLLM-Chat-13b'><img src='https://img.shields.io/badge/%F0%9F%A4%97%20Hugging%20Face-Model-blue'></a>
|
| 255 |
<a href='https://arxiv.org/pdf/2312.00738.pdf'><img src='https://img.shields.io/badge/Paper-PDF-red'></a>
|
|
|
|
| 1143 |
try:
|
| 1144 |
dlang = detect_lang(text)
|
| 1145 |
except Exception as e:
|
| 1146 |
+
# print(f'Error: {e}')
|
| 1147 |
if "No features in text." in str(e):
|
| 1148 |
return "en"
|
| 1149 |
else:
|