acumplid
commited on
Commit
•
4c8718d
1
Parent(s):
64e4d83
Adapted demo to new theme
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import os
|
|
2 |
from dotenv import load_dotenv
|
3 |
import gradio as gr
|
4 |
from gradio.components import Textbox, Button, Slider, Checkbox
|
5 |
-
from AinaTheme import
|
6 |
from sagemaker_endpoint import invoke_endpoint
|
7 |
|
8 |
load_dotenv()
|
@@ -16,7 +16,6 @@ def submit_input(input_, max_new_tokens, repetition_penalty, top_k, top_p, do_sa
|
|
16 |
if input_.strip() == "":
|
17 |
gr.Warning('Not possible to inference an empty input')
|
18 |
return None
|
19 |
-
|
20 |
model_parameters = {
|
21 |
"max_new_tokens": max_new_tokens,
|
22 |
"repetition_penalty": repetition_penalty,
|
@@ -53,7 +52,7 @@ def clear():
|
|
53 |
)
|
54 |
|
55 |
def gradio_app():
|
56 |
-
with gr.Blocks(
|
57 |
with gr.Row():
|
58 |
with gr.Column(scale=0.1):
|
59 |
gr.Image("ginesta_small.jpg", elem_id="flor-banner", scale=1, height=256, width=256, show_label=False, show_download_button = False, show_share_button = False)
|
@@ -69,7 +68,7 @@ def gradio_app():
|
|
69 |
|
70 |
"""
|
71 |
)
|
72 |
-
with gr.Row(
|
73 |
with gr.Column(variant="panel"):
|
74 |
placeholder_max_token = Textbox(
|
75 |
visible=False,
|
|
|
2 |
from dotenv import load_dotenv
|
3 |
import gradio as gr
|
4 |
from gradio.components import Textbox, Button, Slider, Checkbox
|
5 |
+
from AinaTheme import theme
|
6 |
from sagemaker_endpoint import invoke_endpoint
|
7 |
|
8 |
load_dotenv()
|
|
|
16 |
if input_.strip() == "":
|
17 |
gr.Warning('Not possible to inference an empty input')
|
18 |
return None
|
|
|
19 |
model_parameters = {
|
20 |
"max_new_tokens": max_new_tokens,
|
21 |
"repetition_penalty": repetition_penalty,
|
|
|
52 |
)
|
53 |
|
54 |
def gradio_app():
|
55 |
+
with gr.Blocks(theme=theme) as demo:
|
56 |
with gr.Row():
|
57 |
with gr.Column(scale=0.1):
|
58 |
gr.Image("ginesta_small.jpg", elem_id="flor-banner", scale=1, height=256, width=256, show_label=False, show_download_button = False, show_share_button = False)
|
|
|
68 |
|
69 |
"""
|
70 |
)
|
71 |
+
with gr.Row(equal_height=True):
|
72 |
with gr.Column(variant="panel"):
|
73 |
placeholder_max_token = Textbox(
|
74 |
visible=False,
|