Spaces:
Sleeping
Sleeping
Commit
·
4094826
1
Parent(s):
af3b18b
Update app.py
Browse files
app.py
CHANGED
@@ -9,7 +9,7 @@ model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
|
|
9 |
# Function to generate questions and answers with configurable parameters
|
10 |
def generate_qa(context, temperature, top_p):
|
11 |
input_text = f"what: {context}"
|
12 |
-
input_ids =
|
13 |
|
14 |
# Generate with configurable parameters
|
15 |
output = model.generate(
|
|
|
9 |
# Function to generate questions and answers with configurable parameters
|
10 |
def generate_qa(context, temperature, top_p):
|
11 |
input_text = f"what: {context}"
|
12 |
+
input_ids = tokenizer(input_text,max_length=400,truncation=True,padding="max_length",return_tensors='pt')
|
13 |
|
14 |
# Generate with configurable parameters
|
15 |
output = model.generate(
|