yashkumarsahu commited on
Commit
c153d9e
·
verified ·
1 Parent(s): 908245b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -3,17 +3,19 @@ import gradio as gr
3
 
4
  pipe = pipeline(
5
  "text-generation",
6
- model="EleutherAI/gpt-neo-1.3B" # aapka chosen LLM
7
  )
8
 
9
  def chat(user_input):
10
  output = pipe(
11
  user_input,
12
- max_length=150,
13
  do_sample=True,
14
  top_k=50,
15
- top_p=0.95,
16
- temperature=0.7
17
  )[0]['generated_text']
18
  return output
19
 
 
 
 
3
 
4
  pipe = pipeline(
5
  "text-generation",
6
+ model="EleutherAI/MPT-7B-Instruct" # or MPT-7B-Instruct for better results
7
  )
8
 
9
  def chat(user_input):
10
  output = pipe(
11
  user_input,
12
+ max_length=100,
13
  do_sample=True,
14
  top_k=50,
15
+ top_p=0.9,
16
+ temperature=0.6
17
  )[0]['generated_text']
18
  return output
19
 
20
+ demo = gr.Interface(fn=chat, inputs="text", outputs="text")
21
+ demo.launch()