hanzla commited on
Commit
afd19d1
1 Parent(s): 4581f8a
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -30,25 +30,25 @@ def chat_function(message, history, system_prompt,max_new_tokens,temperature):
30
  pipeline.tokenizer.eos_token_id,
31
  pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
32
  ]
 
33
  outputs = pipeline(
34
  prompt,
35
  max_new_tokens=max_new_tokens,
36
  eos_token_id=terminators,
37
  do_sample=True,
38
- temperature=temperature,
39
  top_p=0.9,
40
  )
41
  return outputs[0]["generated_text"][len(prompt):]
42
 
43
  gr.ChatInterface(
44
  chat_function,
45
- chatbot=gr.Chatbot(height=300),
46
  textbox=gr.Textbox(placeholder="Enter message here", container=False, scale=7),
47
  title="LLAMA 3 8B Chat",
48
  description="""
49
- This space is dedicated for chatting with Meta Latest LLM - Llama 8b Instruct. Find this model here: https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct
50
-
51
- Feel free to play around with different prompt and hyper-parameter
52
  """,
53
  theme="soft",
54
  additional_inputs=[
 
30
  pipeline.tokenizer.eos_token_id,
31
  pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
32
  ]
33
+ temp = temperature + 0.1
34
  outputs = pipeline(
35
  prompt,
36
  max_new_tokens=max_new_tokens,
37
  eos_token_id=terminators,
38
  do_sample=True,
39
+ temperature=temp,
40
  top_p=0.9,
41
  )
42
  return outputs[0]["generated_text"][len(prompt):]
43
 
44
  gr.ChatInterface(
45
  chat_function,
46
+ chatbot=gr.Chatbot(height=500),
47
  textbox=gr.Textbox(placeholder="Enter message here", container=False, scale=7),
48
  title="LLAMA 3 8B Chat",
49
  description="""
50
+ This space is dedicated for chatting with Meta Latest LLM - Llama 8b Instruct. Find this model here: https://huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct
51
+ Feel free to play with customization in the "Additional Inputs".
 
52
  """,
53
  theme="soft",
54
  additional_inputs=[