Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import json
|
2 |
import requests
|
3 |
import gradio as gr
|
|
|
4 |
|
5 |
API_TOKEN='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'
|
6 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
@@ -28,7 +29,8 @@ def query(text):
|
|
28 |
"inputs": text,
|
29 |
"parameters": {
|
30 |
"max_length": 250,
|
31 |
-
"temperature": 0.9
|
|
|
32 |
},
|
33 |
}
|
34 |
|
@@ -51,5 +53,6 @@ with gr.Blocks() as demo:
|
|
51 |
btn = gr.Button("Generate")
|
52 |
output1 = gr.Textbox(lines=4,label='1')
|
53 |
btn.click(query,inputs=[textbox], outputs=[output1])
|
|
|
54 |
|
55 |
demo.launch()
|
|
|
1 |
import json
|
2 |
import requests
|
3 |
import gradio as gr
|
4 |
+
import random
|
5 |
|
6 |
API_TOKEN='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'
|
7 |
headers = {"Authorization": f"Bearer {API_TOKEN}"}
|
|
|
29 |
"inputs": text,
|
30 |
"parameters": {
|
31 |
"max_length": 250,
|
32 |
+
"temperature": 0.9,
|
33 |
+
"seed":random.randint(0, 100),
|
34 |
},
|
35 |
}
|
36 |
|
|
|
53 |
btn = gr.Button("Generate")
|
54 |
output1 = gr.Textbox(lines=4,label='1')
|
55 |
btn.click(query,inputs=[textbox], outputs=[output1])
|
56 |
+
|
57 |
|
58 |
demo.launch()
|