Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -5,7 +5,7 @@ from transformers import pipeline
|
|
5 |
# Initialize the model
|
6 |
try:
|
7 |
model_name = "tiiuae/falcon-40b-instruct" # Ensure this is the correct model name
|
8 |
-
nlp_model = pipeline('text-generation', model=model_name)
|
9 |
print("Model loaded successfully.")
|
10 |
except Exception as e:
|
11 |
nlp_model = None
|
@@ -33,4 +33,4 @@ iface = gr.Interface(
|
|
33 |
|
34 |
# Essential for Hugging Face Spaces
|
35 |
if __name__ == "__main__":
|
36 |
-
iface.launch()
|
|
|
5 |
# Initialize the model
|
6 |
try:
|
7 |
model_name = "tiiuae/falcon-40b-instruct" # Ensure this is the correct model name
|
8 |
+
nlp_model = pipeline('text-generation', model=model_name, trust_remote_code=True) # Added trust_remote_code=True
|
9 |
print("Model loaded successfully.")
|
10 |
except Exception as e:
|
11 |
nlp_model = None
|
|
|
33 |
|
34 |
# Essential for Hugging Face Spaces
|
35 |
if __name__ == "__main__":
|
36 |
+
iface.launch(share=True)
|