0x7o commited on
Commit
d73e65e
1 Parent(s): ec93e16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -7,8 +7,8 @@ from threading import Thread
7
 
8
  # Loading the tokenizer and model from Hugging Face's model hub.
9
  if torch.cuda.is_available():
10
- tokenizer = AutoTokenizer.from_pretrained("upstage/SOLAR-10.7B-Instruct-v1.0")
11
- model = AutoModelForCausalLM.from_pretrained("upstage/SOLAR-10.7B-Instruct-v1.0", torch_dtype=torch.float16, device_map="auto")
12
 
13
 
14
  # Defining a custom stopping criteria class for the model's text generation.
@@ -41,8 +41,8 @@ def predict(message, history):
41
  do_sample=True,
42
  top_p=0.95,
43
  top_k=50,
44
- temperature=0.2,
45
- repetition_penalty=1.2,
46
  num_beams=1,
47
  stopping_criteria=StoppingCriteriaList([stop])
48
  )
@@ -58,7 +58,7 @@ def predict(message, history):
58
 
59
  # Setting up the Gradio chat interface.
60
  gr.ChatInterface(predict,
61
- title="SOLAR 10.7B Instruct v1.0",
62
  description="Warning. All answers are generated and may contain inaccurate information.",
63
  examples=['How do you cook fish?', 'Who is the president of the United States?']
64
  ).launch() # Launching the web interface.
 
7
 
8
  # Loading the tokenizer and model from Hugging Face's model hub.
9
  if torch.cuda.is_available():
10
+ tokenizer = AutoTokenizer.from_pretrained("Qwen/Qwen1.5-7B-Chat")
11
+ model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen1.5-7B-Chat", torch_dtype=torch.float16, device_map="auto")
12
 
13
 
14
  # Defining a custom stopping criteria class for the model's text generation.
 
41
  do_sample=True,
42
  top_p=0.95,
43
  top_k=50,
44
+ temperature=0.7,
45
+ repetition_penalty=1.0,
46
  num_beams=1,
47
  stopping_criteria=StoppingCriteriaList([stop])
48
  )
 
58
 
59
  # Setting up the Gradio chat interface.
60
  gr.ChatInterface(predict,
61
+ title="Qwen1.5 7B Chat Demo",
62
  description="Warning. All answers are generated and may contain inaccurate information.",
63
  examples=['How do you cook fish?', 'Who is the president of the United States?']
64
  ).launch() # Launching the web interface.