Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,8 +2,8 @@ import os
|
|
2 |
import gradio as gr
|
3 |
from langchain.llms import HuggingFaceHub
|
4 |
|
5 |
-
|
6 |
-
|
7 |
llamma_template = """[INST]<<SYS>>I want you to act as document language translator. You do translation {source} texts in document into then you return to me the translated document AND DO NOTHING ELSE.<</SYS>>
|
8 |
Begin of the document:
|
9 |
{query}
|
@@ -28,8 +28,8 @@ model_kwargs={
|
|
28 |
"stop" : ["</s>","<|endoftext|>","<|end|>"],
|
29 |
}
|
30 |
|
31 |
-
llm1 = HuggingFaceHub(repo_id=
|
32 |
-
llm2 = HuggingFaceHub(repo_id=
|
33 |
|
34 |
def translation(source, target, text):
|
35 |
response = text
|
|
|
2 |
import gradio as gr
|
3 |
from langchain.llms import HuggingFaceHub
|
4 |
|
5 |
+
llama_repo = os.getenv('HF_MODEL_LLAMA_REPO')
|
6 |
+
starchat_repo = os.getenv('HF_MODEL_STARCHAT_REPO')
|
7 |
llamma_template = """[INST]<<SYS>>I want you to act as document language translator. You do translation {source} texts in document into then you return to me the translated document AND DO NOTHING ELSE.<</SYS>>
|
8 |
Begin of the document:
|
9 |
{query}
|
|
|
28 |
"stop" : ["</s>","<|endoftext|>","<|end|>"],
|
29 |
}
|
30 |
|
31 |
+
llm1 = HuggingFaceHub(repo_id=llama_repo, task="text-generation", model_kwargs=model_kwargs)
|
32 |
+
llm2 = HuggingFaceHub(repo_id=starchat_repo, task="text-generation", model_kwargs=model_kwargs)
|
33 |
|
34 |
def translation(source, target, text):
|
35 |
response = text
|