Commit
·
b594949
1
Parent(s):
4eb1ca1
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,11 +38,11 @@ if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
|
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
-
def generate(prompt: str, seed: int) -> str:
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
|
| 47 |
|
| 48 |
examples = [
|
|
@@ -75,11 +75,11 @@ with gr.Blocks(css='style.css') as demo:
|
|
| 75 |
info='If set to -1, a different seed will be used each time.')
|
| 76 |
|
| 77 |
inputs = [prompt, seed]
|
| 78 |
-
gr.Examples(examples=examples,
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
|
| 84 |
# prompt.submit(fn=generate, inputs=inputs, outputs=result)
|
| 85 |
# run_button.click(fn=generate, inputs=inputs, outputs=result)
|
|
|
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
+
# def generate(prompt: str, seed: int) -> str:
|
| 42 |
+
# if seed == -1:
|
| 43 |
+
# seed = random.randint(0, 1000000)
|
| 44 |
+
# torch.manual_seed(seed)
|
| 45 |
+
# return "text"
|
| 46 |
|
| 47 |
|
| 48 |
examples = [
|
|
|
|
| 75 |
info='If set to -1, a different seed will be used each time.')
|
| 76 |
|
| 77 |
inputs = [prompt, seed]
|
| 78 |
+
# gr.Examples(examples=examples,
|
| 79 |
+
# inputs=inputs,
|
| 80 |
+
# outputs=result,
|
| 81 |
+
# fn=generate,
|
| 82 |
+
# cache_examples=os.getenv('SYSTEM') == 'spaces')
|
| 83 |
|
| 84 |
# prompt.submit(fn=generate, inputs=inputs, outputs=result)
|
| 85 |
# run_button.click(fn=generate, inputs=inputs, outputs=result)
|