Spaces:
Build error
Build error
Upload utils.py
Browse files
utils.py
CHANGED
|
@@ -44,8 +44,8 @@ def get_t5_model():
|
|
| 44 |
def get_flan_t5_model():
|
| 45 |
return pipeline(
|
| 46 |
"summarization",
|
| 47 |
-
model="google/flan-t5-
|
| 48 |
-
tokenizer="google/flan-t5-
|
| 49 |
max_length=512,
|
| 50 |
# length_penalty = 0
|
| 51 |
)
|
|
@@ -375,11 +375,8 @@ def gpt_model(prompt):
|
|
| 375 |
response = openai.Completion.create(
|
| 376 |
model="text-davinci-003",
|
| 377 |
prompt=prompt,
|
| 378 |
-
temperature=0
|
| 379 |
max_tokens=1024,
|
| 380 |
-
top_p=1.0,
|
| 381 |
-
frequency_penalty=0.5,
|
| 382 |
-
presence_penalty=1,
|
| 383 |
)
|
| 384 |
return response.choices[0].text
|
| 385 |
|
|
|
|
| 44 |
def get_flan_t5_model():
|
| 45 |
return pipeline(
|
| 46 |
"summarization",
|
| 47 |
+
model="google/flan-t5-small",
|
| 48 |
+
tokenizer="google/flan-t5-small",
|
| 49 |
max_length=512,
|
| 50 |
# length_penalty = 0
|
| 51 |
)
|
|
|
|
| 375 |
response = openai.Completion.create(
|
| 376 |
model="text-davinci-003",
|
| 377 |
prompt=prompt,
|
| 378 |
+
temperature=0,
|
| 379 |
max_tokens=1024,
|
|
|
|
|
|
|
|
|
|
| 380 |
)
|
| 381 |
return response.choices[0].text
|
| 382 |
|