Spaces:
Build error
Build error
fix docker
Browse files
model.py
CHANGED
|
@@ -22,12 +22,12 @@ class ChallengePromptGenerator:
|
|
| 22 |
self.tokenizer = AutoTokenizer.from_pretrained(model_local_dir)
|
| 23 |
|
| 24 |
def infer_prompt(
|
| 25 |
-
self,
|
| 26 |
prompts,
|
| 27 |
max_generation_length=77,
|
| 28 |
beam_size=1,
|
| 29 |
sampling_temperature=0.9,
|
| 30 |
-
sampling_topk=
|
| 31 |
sampling_topp=1
|
| 32 |
):
|
| 33 |
# Add bos
|
|
@@ -62,4 +62,4 @@ class ChallengePromptGenerator:
|
|
| 62 |
if out[-1] != ".":
|
| 63 |
out = ".".join(out.split(".")[:-1]) + "."
|
| 64 |
outputs.append(out)
|
| 65 |
-
return
|
|
|
|
| 22 |
self.tokenizer = AutoTokenizer.from_pretrained(model_local_dir)
|
| 23 |
|
| 24 |
def infer_prompt(
|
| 25 |
+
self,
|
| 26 |
prompts,
|
| 27 |
max_generation_length=77,
|
| 28 |
beam_size=1,
|
| 29 |
sampling_temperature=0.9,
|
| 30 |
+
sampling_topk=100,
|
| 31 |
sampling_topp=1
|
| 32 |
):
|
| 33 |
# Add bos
|
|
|
|
| 62 |
if out[-1] != ".":
|
| 63 |
out = ".".join(out.split(".")[:-1]) + "."
|
| 64 |
outputs.append(out)
|
| 65 |
+
return outputs
|