Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,19 +9,9 @@ st.set_page_config(page_title="Python to C++17 Translator", layout="wide")
|
|
| 9 |
if "messages" not in st.session_state:
|
| 10 |
st.session_state.messages = []
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
"Modelo usado:",
|
| 16 |
-
[
|
| 17 |
-
"Qwen/Qwen2.5-Coder-32B-Instruct"
|
| 18 |
-
],
|
| 19 |
-
index=0
|
| 20 |
-
)
|
| 21 |
-
|
| 22 |
-
st.markdown("### Entorno de Ejecuci贸n")
|
| 23 |
-
st.code("g++ -O3 -std=c++17", language="bash")
|
| 24 |
-
|
| 25 |
if st.button("Limpiar Historial"):
|
| 26 |
st.session_state.messages = []
|
| 27 |
st.rerun()
|
|
@@ -94,7 +84,7 @@ if prompt := st.chat_input("Escribe o pega tu c贸digo Python aqui:"):
|
|
| 94 |
st.error("ERROR CR脥TICO: No se encontr贸 el HF_TOKEN. Ve a Settings -> Variables and secrets y configuralo.")
|
| 95 |
st.stop()
|
| 96 |
|
| 97 |
-
client = InferenceClient(model=
|
| 98 |
|
| 99 |
messages_for_hf = [
|
| 100 |
{"role": "system", "content": get_system_prompt()},
|
|
|
|
| 9 |
if "messages" not in st.session_state:
|
| 10 |
st.session_state.messages = []
|
| 11 |
|
| 12 |
+
MODEL_ID = "Qwen/Qwen2.5-Coder-32B-Instruct"
|
| 13 |
+
|
| 14 |
+
with st.sidebar:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
if st.button("Limpiar Historial"):
|
| 16 |
st.session_state.messages = []
|
| 17 |
st.rerun()
|
|
|
|
| 84 |
st.error("ERROR CR脥TICO: No se encontr贸 el HF_TOKEN. Ve a Settings -> Variables and secrets y configuralo.")
|
| 85 |
st.stop()
|
| 86 |
|
| 87 |
+
client = InferenceClient(model=MODEL_ID, token=hf_token)
|
| 88 |
|
| 89 |
messages_for_hf = [
|
| 90 |
{"role": "system", "content": get_system_prompt()},
|