ginipick commited on
Commit
75b2e84
·
verified ·
1 Parent(s): 7c4abe8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -5,6 +5,7 @@ import gc
5
  import os
6
  import datetime
7
  import time
 
8
 
9
  # --- Configuration ---
10
  MODEL_ID = "naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-0.5B"
@@ -199,7 +200,8 @@ def warmup_model():
199
  finally:
200
  gc.collect()
201
 
202
- # --- Inference Function ---
 
203
  def predict(message, history):
204
  """
205
  Generates response using HyperCLOVAX.
@@ -346,5 +348,5 @@ if __name__ == "__main__":
346
  print("--- Launching Gradio App ---")
347
  demo.queue().launch(
348
  # share=True # Uncomment for public link
349
- # server_name="0.0.0.0" # Uncomment for local network access
350
  )
 
5
  import os
6
  import datetime
7
  import time
8
+ import spaces # Import spaces module for GPU acceleration
9
 
10
  # --- Configuration ---
11
  MODEL_ID = "naver-hyperclovax/HyperCLOVAX-SEED-Text-Instruct-0.5B"
 
200
  finally:
201
  gc.collect()
202
 
203
+ # --- Inference Function with GPU decorator ---
204
+ @spaces.GPU() # Important: Add the spaces.GPU() decorator for ZeroGPU
205
  def predict(message, history):
206
  """
207
  Generates response using HyperCLOVAX.
 
348
  print("--- Launching Gradio App ---")
349
  demo.queue().launch(
350
  # share=True # Uncomment for public link
351
+ server_name="0.0.0.0" # Enable external access
352
  )