futranbg commited on
Commit
f5d37e2
·
1 Parent(s): 14a7588

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -2,8 +2,8 @@ import os
2
  import gradio as gr
3
  from langchain.llms import HuggingFaceHub
4
 
5
- model_repo = os.getenv('HF_MODEL_LLAMA_REPO')
6
- model_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,8 +28,8 @@ model_kwargs={
28
  "stop" : ["</s>","<|endoftext|>","<|end|>"],
29
  }
30
 
31
- llm1 = HuggingFaceHub(repo_id=model_repo, task="text-generation", model_kwargs=model_kwargs)
32
- llm2 = HuggingFaceHub(repo_id=model_repo, task="text-generation", model_kwargs=model_kwargs)
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