VicGerardoPR commited on
Commit
627bb12
·
verified ·
1 Parent(s): 9370e47

Upload 4 files

Browse files
.huggingface.yml CHANGED
@@ -1,6 +1,13 @@
1
 
2
- # Archivo de configuración para Hugging Face Spaces
3
  title: Asistente Cuántico para PYMES
 
 
 
4
  sdk: streamlit
5
- python_version: 3.10
6
  app_file: app.py
 
 
 
 
 
1
 
2
+ ---
3
  title: Asistente Cuántico para PYMES
4
+ emoji: ⚛️
5
+ colorFrom: indigo
6
+ colorTo: purple
7
  sdk: streamlit
8
+ sdk_version: "1.34.0"
9
  app_file: app.py
10
+ pinned: false
11
+ ---
12
+
13
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
Dockerfile CHANGED
@@ -1,26 +1,20 @@
1
 
2
- # Imagen base ligera con Python
3
  FROM python:3.10-slim
4
 
5
- # Variables de entorno para Streamlit
6
  ENV PYTHONUNBUFFERED=1
7
  ENV STREAMLIT_PORT=7860
8
  ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
9
 
10
- # Crear directorio de trabajo
11
  WORKDIR /app
12
 
13
- # Copiar archivos
14
  COPY requirements.txt ./
15
  COPY asistente_cuantico_pymes_app.py ./app.py
16
  COPY README.md ./
 
17
 
18
- # Instalar dependencias
19
  RUN pip install --upgrade pip \
20
  && pip install --no-cache-dir -r requirements.txt
21
 
22
- # Puerto para Hugging Face Spaces
23
  EXPOSE 7860
24
 
25
- # Comando de inicio
26
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.enableCORS=false"]
 
1
 
 
2
  FROM python:3.10-slim
3
 
 
4
  ENV PYTHONUNBUFFERED=1
5
  ENV STREAMLIT_PORT=7860
6
  ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
7
 
 
8
  WORKDIR /app
9
 
 
10
  COPY requirements.txt ./
11
  COPY asistente_cuantico_pymes_app.py ./app.py
12
  COPY README.md ./
13
+ COPY .huggingface.yml ./
14
 
 
15
  RUN pip install --upgrade pip \
16
  && pip install --no-cache-dir -r requirements.txt
17
 
 
18
  EXPOSE 7860
19
 
 
20
  CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.enableCORS=false"]
asistente_cuantico_pymes_app.py CHANGED
@@ -1,12 +1,11 @@
1
 
2
  import streamlit as st
3
- from langchain.llms import HuggingFaceHub
4
  from langchain.chains import LLMChain
5
  from langchain.prompts import PromptTemplate
6
  import pandas as pd
7
- from qiskit import QuantumCircuit, execute
8
- from qiskit_aer import Aer
9
-
10
 
11
  # Cargar datos financieros/operativos
12
  def load_data(uploaded_file):
@@ -19,9 +18,9 @@ def run_quantum_logic():
19
  qc = QuantumCircuit(1, 1)
20
  qc.h(0)
21
  qc.measure(0, 0)
22
- backend = Aer.get_backend('qasm_simulator')
23
- job = execute(qc, backend, shots=1024)
24
- result = job.result().get_counts()
25
  return result
26
 
27
  # Configurar LLM con Hugging Face (puedes usar local más adelante)
 
1
 
2
  import streamlit as st
3
+ from langchain_community.llms import HuggingFaceHub
4
  from langchain.chains import LLMChain
5
  from langchain.prompts import PromptTemplate
6
  import pandas as pd
7
+ from qiskit import QuantumCircuit, transpile
8
+ from qiskit_aer import AerSimulator
 
9
 
10
  # Cargar datos financieros/operativos
11
  def load_data(uploaded_file):
 
18
  qc = QuantumCircuit(1, 1)
19
  qc.h(0)
20
  qc.measure(0, 0)
21
+ simulator = AerSimulator()
22
+ compiled_circuit = transpile(qc, simulator)
23
+ result = simulator.run(compiled_circuit, shots=1024).result().get_counts()
24
  return result
25
 
26
  # Configurar LLM con Hugging Face (puedes usar local más adelante)
requirements.txt CHANGED
@@ -1,11 +1,12 @@
 
1
  streamlit
2
  langchain
3
- langchain_community
4
  openai
5
  transformers
6
  accelerate
7
  qiskit
 
 
8
  pandas
9
  huggingface_hub
10
- qiskit-aer
11
-
 
1
+
2
  streamlit
3
  langchain
4
+ langchain-community
5
  openai
6
  transformers
7
  accelerate
8
  qiskit
9
+ qiskit-aer
10
+ qiskit-ibm-runtime
11
  pandas
12
  huggingface_hub