Update app.py
Browse files
app.py
CHANGED
|
@@ -71,12 +71,12 @@ def get_model(temperature, top_p, repetition_penalty):
|
|
| 71 |
"temperature": temperature,
|
| 72 |
"top_p": top_p,
|
| 73 |
"repetition_penalty": repetition_penalty,
|
| 74 |
-
"max_length":
|
| 75 |
},
|
| 76 |
huggingfacehub_api_token=huggingface_token
|
| 77 |
)
|
| 78 |
|
| 79 |
-
def generate_chunked_response(model, prompt, max_tokens=
|
| 80 |
full_response = ""
|
| 81 |
for i in range(max_chunks):
|
| 82 |
chunk = model(prompt + full_response, max_new_tokens=max_tokens)
|
|
|
|
| 71 |
"temperature": temperature,
|
| 72 |
"top_p": top_p,
|
| 73 |
"repetition_penalty": repetition_penalty,
|
| 74 |
+
"max_length": 1000
|
| 75 |
},
|
| 76 |
huggingfacehub_api_token=huggingface_token
|
| 77 |
)
|
| 78 |
|
| 79 |
+
def generate_chunked_response(model, prompt, max_tokens=1000, max_chunks=5):
|
| 80 |
full_response = ""
|
| 81 |
for i in range(max_chunks):
|
| 82 |
chunk = model(prompt + full_response, max_new_tokens=max_tokens)
|