Spaces:
Sleeping
Sleeping
jordigonzm
commited on
Commit
•
fb3e46a
1
Parent(s):
470317d
global model, tokenizer
Browse files
app.py
CHANGED
@@ -62,6 +62,9 @@ def generate(
|
|
62 |
top_k: int = 50,
|
63 |
repetition_penalty: float = 1.2,
|
64 |
) -> Iterator[str]:
|
|
|
|
|
|
|
65 |
conversation = []
|
66 |
if system_prompt:
|
67 |
conversation.append({"role": "system", "content": system_prompt})
|
|
|
62 |
top_k: int = 50,
|
63 |
repetition_penalty: float = 1.2,
|
64 |
) -> Iterator[str]:
|
65 |
+
global model, tokenizer
|
66 |
+
if model is None or tokenizer is None:
|
67 |
+
load_model()
|
68 |
conversation = []
|
69 |
if system_prompt:
|
70 |
conversation.append({"role": "system", "content": system_prompt})
|