Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
|
|
5 |
tokenizer = AutoTokenizer.from_pretrained("sambanovasystems/SambaLingo-Hungarian-Chat", use_fast=False)
|
6 |
model = AutoModelForCausalLM.from_pretrained("sambanovasystems/SambaLingo-Hungarian-Chat", device_map="auto", torch_dtype="auto")
|
7 |
|
8 |
-
# Create the pipeline
|
9 |
-
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map="auto", use_fast=False)
|
10 |
|
11 |
# Define the chat function
|
12 |
def chat(question):
|
|
|
5 |
tokenizer = AutoTokenizer.from_pretrained("sambanovasystems/SambaLingo-Hungarian-Chat", use_fast=False)
|
6 |
model = AutoModelForCausalLM.from_pretrained("sambanovasystems/SambaLingo-Hungarian-Chat", device_map="auto", torch_dtype="auto")
|
7 |
|
8 |
+
# Create the pipeline with max_new_tokens parameter
|
9 |
+
pipe = pipeline("text-generation", model=model, tokenizer=tokenizer, device_map="auto", use_fast=False, max_length=1024)
|
10 |
|
11 |
# Define the chat function
|
12 |
def chat(question):
|