Rename app_replit.py to app_from_replit.py
Browse files
app_replit.py โ app_from_replit.py
RENAMED
@@ -2,10 +2,9 @@ from os import environ
|
|
2 |
import logging
|
3 |
from fastapi import FastAPI, Request
|
4 |
import subprocess
|
5 |
-
# from transformers import pipeline
|
6 |
from huggingface_hub import InferenceClient, login
|
7 |
import langid
|
8 |
-
|
9 |
|
10 |
# Configure logging
|
11 |
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
|
@@ -41,8 +40,11 @@ def generate_response(text):
|
|
41 |
language = detect_language(text)
|
42 |
|
43 |
if language == "hebrew":
|
44 |
-
content = "
|
45 |
-
|
|
|
|
|
|
|
46 |
elif language == "english":
|
47 |
content = "keep it short but tell your decision making process, " + text
|
48 |
model = "mistralai/Mistral-Nemo-Instruct-2407"
|
|
|
2 |
import logging
|
3 |
from fastapi import FastAPI, Request
|
4 |
import subprocess
|
|
|
5 |
from huggingface_hub import InferenceClient, login
|
6 |
import langid
|
7 |
+
|
8 |
|
9 |
# Configure logging
|
10 |
logging.basicConfig(format="%(asctime)s - %(levelname)s - %(message)s",
|
|
|
40 |
language = detect_language(text)
|
41 |
|
42 |
if language == "hebrew":
|
43 |
+
# content = "answer in hebrew, keep it short but tell your decision making process, " + text
|
44 |
+
content = "ืชืฉืืืจ ืขื ืชืฉืืื ืงืฆืจื, ืืื ืชืกืคืจ ืืื ืงืืืืช ืืช ืืืืืื, " + text
|
45 |
+
model = "yam-peleg/Hebrew-Gemma-11B-V2" # too large.
|
46 |
+
# model = "google/gemma-2-2b-it"
|
47 |
+
#model = "microsoft/Phi-3.5-mini-instruct"
|
48 |
elif language == "english":
|
49 |
content = "keep it short but tell your decision making process, " + text
|
50 |
model = "mistralai/Mistral-Nemo-Instruct-2407"
|