Spaces:
Sleeping
Sleeping
locorene1000
commited on
Commit
•
a327ee7
1
Parent(s):
422ddef
app.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
# Configuración del cliente OpenAI con la API de NVIDIA
|
@@ -97,11 +98,13 @@ def mejorar_resolucion(input_text):
|
|
97 |
top_p=0.7,
|
98 |
max_tokens=1024,
|
99 |
stream=True
|
|
|
|
|
|
|
100 |
for chunk in completion:
|
101 |
if chunk.choices[0].delta.content is not None:
|
102 |
response_content += chunk.choices[0].delta.content
|
103 |
|
104 |
-
|
105 |
return response_content.strip()
|
106 |
except Exception as e:
|
107 |
return f"Error: {e}"
|
@@ -122,4 +125,4 @@ def gradio_interface():
|
|
122 |
demo.launch()
|
123 |
|
124 |
# Lanzamiento de la interfaz de Gradio
|
125 |
-
gradio_interface()
|
|
|
1 |
+
from openai import OpenAI
|
2 |
import gradio as gr
|
3 |
|
4 |
# Configuración del cliente OpenAI con la API de NVIDIA
|
|
|
98 |
top_p=0.7,
|
99 |
max_tokens=1024,
|
100 |
stream=True
|
101 |
+
)
|
102 |
+
|
103 |
+
response_content = ""
|
104 |
for chunk in completion:
|
105 |
if chunk.choices[0].delta.content is not None:
|
106 |
response_content += chunk.choices[0].delta.content
|
107 |
|
|
|
108 |
return response_content.strip()
|
109 |
except Exception as e:
|
110 |
return f"Error: {e}"
|
|
|
125 |
demo.launch()
|
126 |
|
127 |
# Lanzamiento de la interfaz de Gradio
|
128 |
+
gradio_interface()
|