Manjushri commited on
Commit
e4efcf3
1 Parent(s): d05f479

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -1,5 +1,5 @@
1
  from transformers import AutoModelForCausalLM, AutoTokenizer
2
- import modin as pd
3
  import gradio as gr
4
 
5
  tokenizer = AutoTokenizer.from_pretrained("KoboldAI/OPT-2.7B-Erebus")
@@ -8,7 +8,7 @@ model = AutoModelForCausalLM.from_pretrained("KoboldAI/OPT-2.7B-Erebus")
8
 
9
  def chat(Prompt):
10
  input_ids = tokenizer(Prompt, return_tensors="pt").input_ids
11
- generated_ids = model.generate(input_ids, max_length=128)
12
  bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
13
  return bot
14
 
 
1
  from transformers import AutoModelForCausalLM, AutoTokenizer
2
+ import modin.pandas as pd
3
  import gradio as gr
4
 
5
  tokenizer = AutoTokenizer.from_pretrained("KoboldAI/OPT-2.7B-Erebus")
 
8
 
9
  def chat(Prompt):
10
  input_ids = tokenizer(Prompt, return_tensors="pt").input_ids
11
+ generated_ids = model.generate(input_ids, max_length=512)
12
  bot = tokenizer.decode(generated_ids[0], skip_special_tokens=True)
13
  return bot
14