Spaces:
Running
on
Zero
Running
on
Zero
Commit
·
fb01acd
1
Parent(s):
c66c30d
do sample
Browse files
app.py
CHANGED
@@ -58,16 +58,17 @@ def predict(code):
|
|
58 |
print(f"Tokenized: {tokenizer.tokenize(prompt)}")
|
59 |
pipe_out = pipe(
|
60 |
prompt,
|
61 |
-
|
62 |
top_k=100,
|
63 |
top_p=0.09,
|
64 |
temperature=1.2,
|
65 |
repetition_penalty=1.1,
|
66 |
-
return_full_text=False
|
67 |
)
|
68 |
print(f"Pipe out: {repr(pipe_out)}")
|
69 |
|
70 |
-
return pipe_out[0][
|
|
|
71 |
|
72 |
demo = gr.Interface(
|
73 |
fn=predict,
|
|
|
58 |
print(f"Tokenized: {tokenizer.tokenize(prompt)}")
|
59 |
pipe_out = pipe(
|
60 |
prompt,
|
61 |
+
do_sample=True,
|
62 |
top_k=100,
|
63 |
top_p=0.09,
|
64 |
temperature=1.2,
|
65 |
repetition_penalty=1.1,
|
66 |
+
return_full_text=False,
|
67 |
)
|
68 |
print(f"Pipe out: {repr(pipe_out)}")
|
69 |
|
70 |
+
return pipe_out[0]["generated_text"]
|
71 |
+
|
72 |
|
73 |
demo = gr.Interface(
|
74 |
fn=predict,
|