Update app.py
Browse files
app.py
CHANGED
@@ -11,9 +11,7 @@ from huggingface_hub import login
|
|
11 |
import os
|
12 |
|
13 |
token = os.environ.get("HF_TOKEN")
|
14 |
-
print(token)
|
15 |
|
16 |
-
openai_token= os.environ.get("OPENAI_API_KEY")
|
17 |
if token:
|
18 |
login(token=token)
|
19 |
else:
|
@@ -91,7 +89,7 @@ llm_engine = InferenceClientModel("Qwen/Qwen2.5-Coder-32B-Instruct")
|
|
91 |
llm_engine = OpenAIServerModel(
|
92 |
model_id="gpt-4o-mini", # Exemplo: ajuste para o modelo OpenAI que deseja usar
|
93 |
api_base="https://api.openai.com/v1",
|
94 |
-
api_key=
|
95 |
)
|
96 |
|
97 |
|
@@ -182,10 +180,10 @@ def create_gradio_interface():
|
|
182 |
with gr.Column():
|
183 |
object_name_input = gr.Textbox(label="Enter an object name", placeholder="e.g. bicycle, car, phone")
|
184 |
generate_button = gr.Button("Generate Evolution")
|
185 |
-
image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, value=default_images, type="filepath")
|
186 |
-
gif_output = gr.Image(label="Generated GIF", value=default_gif_path, type="filepath")
|
187 |
-
|
188 |
-
|
189 |
|
190 |
generate_button.click(fn=generate_object_history, inputs=[object_name_input], outputs=[image_gallery, gif_output])
|
191 |
|
|
|
11 |
import os
|
12 |
|
13 |
token = os.environ.get("HF_TOKEN")
|
|
|
14 |
|
|
|
15 |
if token:
|
16 |
login(token=token)
|
17 |
else:
|
|
|
89 |
llm_engine = OpenAIServerModel(
|
90 |
model_id="gpt-4o-mini", # Exemplo: ajuste para o modelo OpenAI que deseja usar
|
91 |
api_base="https://api.openai.com/v1",
|
92 |
+
api_key=os.environ.get("OPENAI_API_KEY")
|
93 |
)
|
94 |
|
95 |
|
|
|
180 |
with gr.Column():
|
181 |
object_name_input = gr.Textbox(label="Enter an object name", placeholder="e.g. bicycle, car, phone")
|
182 |
generate_button = gr.Button("Generate Evolution")
|
183 |
+
#image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, value=default_images, type="filepath")
|
184 |
+
#gif_output = gr.Image(label="Generated GIF", value=default_gif_path, type="filepath")
|
185 |
+
image_gallery = gr.Gallery(label="Generated Images", columns=3, rows=1, type="filepath")
|
186 |
+
gif_output = gr.Image(label="Generated GIF", type="filepath")
|
187 |
|
188 |
generate_button.click(fn=generate_object_history, inputs=[object_name_input], outputs=[image_gallery, gif_output])
|
189 |
|