Update app.py
Browse files
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=
|
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 |
|