Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -25,13 +25,19 @@ user_input = st.text_area("Enter your text prompt:", "Type something here...")
|
|
| 25 |
|
| 26 |
# Load the selected model using the pipeline
|
| 27 |
@st.cache_resource
|
| 28 |
-
def load_model(model_name):
|
| 29 |
# return pipeline("text-generation", model=model_name, framework="tf")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
with warnings.catch_warnings():
|
| 31 |
-
|
| 32 |
access_token = os.getenv("HF_ACCESS_TOKEN") # Use an environment variable for the access token
|
| 33 |
return pipeline("text-generation", model=model_name, framework="tf", use_auth_token=access_token) # Use TensorFlow framework
|
| 34 |
-
|
| 35 |
|
| 36 |
# Button to run the model
|
| 37 |
if st.button("Generate Response"):
|
|
|
|
| 25 |
|
| 26 |
# Load the selected model using the pipeline
|
| 27 |
@st.cache_resource
|
| 28 |
+
#def load_model(model_name):
|
| 29 |
# return pipeline("text-generation", model=model_name, framework="tf")
|
| 30 |
+
# with warnings.catch_warnings():
|
| 31 |
+
# warnings.simplefilter("ignore")
|
| 32 |
+
# access_token = os.getenv("HF_ACCESS_TOKEN") # Use an environment variable for the access token
|
| 33 |
+
# return pipeline("text-generation", model=model_name, framework="tf", use_auth_token=access_token) # Use TensorFlow framework
|
| 34 |
+
|
| 35 |
+
def load_model(model_name):
|
| 36 |
with warnings.catch_warnings():
|
| 37 |
+
warnings.simplefilter("ignore")
|
| 38 |
access_token = os.getenv("HF_ACCESS_TOKEN") # Use an environment variable for the access token
|
| 39 |
return pipeline("text-generation", model=model_name, framework="tf", use_auth_token=access_token) # Use TensorFlow framework
|
| 40 |
+
|
| 41 |
|
| 42 |
# Button to run the model
|
| 43 |
if st.button("Generate Response"):
|