Yoxas commited on
Commit
384b004
·
verified ·
1 Parent(s): 64416b1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -5,7 +5,11 @@ import spaces
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
- pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", framework="pt", trust_remote_code=True)
 
 
 
 
9
 
10
  @spaces.GPU(duration=120)
11
  def respond(
 
5
  """
6
  For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
7
  """
8
+ try:
9
+ pipe = pipeline("text-generation", model="microsoft/Phi-3-mini-4k-instruct", framework="pt", trust_remote_code=True)
10
+ except Exception as e:
11
+ print(f"Error loading model: {e}")
12
+ pipe = None
13
 
14
  @spaces.GPU(duration=120)
15
  def respond(