Carlos012 commited on
Commit
738127a
1 Parent(s): dcc3100

Update (Code): Update code

Browse files
Files changed (2) hide show
  1. Dockerfile +4 -0
  2. app.py +2 -4
Dockerfile CHANGED
@@ -1,5 +1,9 @@
1
  FROM python:3.12-slim
2
 
 
 
 
 
3
  WORKDIR /app
4
  COPY requirements.txt .
5
  RUN pip install -r requirements.txt
 
1
  FROM python:3.12-slim
2
 
3
+ RUN apt-get update && apt-get install -y \
4
+ git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1 \
5
+ && rm -rf /var/lib/apt/lists/*
6
+
7
  WORKDIR /app
8
  COPY requirements.txt .
9
  RUN pip install -r requirements.txt
app.py CHANGED
@@ -74,13 +74,11 @@ class GestorModelo:
74
 
75
  def descargar_pesos(self) -> Optional[str]:
76
  try:
77
- token = os.getenv("HF_TOKEN")
78
  nombre_modelo = self._resolver_nombre_modelo()
79
 
80
  ruta_modelo = hf_hub_download(
81
  repo_id=self.config.repo_id,
82
  filename=nombre_modelo,
83
- token=token,
84
  repo_type="model",
85
  )
86
  return ruta_modelo
@@ -519,7 +517,7 @@ def crear_html_error(mensaje: str) -> str:
519
  <div style="background-color: #fff3cd; border: 2px solid #ffc107;
520
  border-radius: 10px; padding: 20px; margin-top: 20px;">
521
  <div style="color: #856404; font-size: 16px; font-weight: 600; margin-bottom: 10px;">
522
- Advertencia
523
  </div>
524
  <div style="color: #856404; font-size: 14px;">
525
  {mensaje}
@@ -697,7 +695,7 @@ def main():
697
  demo.launch(
698
  server_name="0.0.0.0",
699
  server_port=7860,
700
- share=True,
701
  show_error=True,
702
  quiet=False,
703
  theme=gr.themes.Soft(primary_hue="blue", secondary_hue="green"),
 
74
 
75
  def descargar_pesos(self) -> Optional[str]:
76
  try:
 
77
  nombre_modelo = self._resolver_nombre_modelo()
78
 
79
  ruta_modelo = hf_hub_download(
80
  repo_id=self.config.repo_id,
81
  filename=nombre_modelo,
 
82
  repo_type="model",
83
  )
84
  return ruta_modelo
 
517
  <div style="background-color: #fff3cd; border: 2px solid #ffc107;
518
  border-radius: 10px; padding: 20px; margin-top: 20px;">
519
  <div style="color: #856404; font-size: 16px; font-weight: 600; margin-bottom: 10px;">
520
+ Notificaci贸n
521
  </div>
522
  <div style="color: #856404; font-size: 14px;">
523
  {mensaje}
 
695
  demo.launch(
696
  server_name="0.0.0.0",
697
  server_port=7860,
698
+ share=False,
699
  show_error=True,
700
  quiet=False,
701
  theme=gr.themes.Soft(primary_hue="blue", secondary_hue="green"),