Spaces:
Sleeping
Sleeping
Try to generate content based on input
Browse files
app.py
CHANGED
|
@@ -1,27 +1,15 @@
|
|
| 1 |
import os
|
| 2 |
-
|
| 3 |
-
#import streamlit as st
|
| 4 |
-
|
| 5 |
-
#x = st.slider('Select a value')
|
| 6 |
-
#st.write(x, 'squared is', x * x)
|
| 7 |
-
|
| 8 |
-
# Get the API key from the environment variable
|
| 9 |
-
api_key = os.getenv("HF_API_KEY")
|
| 10 |
-
|
| 11 |
-
# Initialize the Inference API with your model and API key
|
| 12 |
-
#api = InferenceApi(repo_id="gpt-3", token=api_key)
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
from huggingface_hub import InferenceClient
|
| 18 |
|
|
|
|
| 19 |
client = InferenceClient(api_key=api_key)
|
| 20 |
|
|
|
|
| 21 |
messages = [
|
| 22 |
{
|
| 23 |
"role": "user",
|
| 24 |
-
"content":
|
| 25 |
}
|
| 26 |
]
|
| 27 |
|
|
|
|
| 1 |
import os
|
| 2 |
+
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
from huggingface_hub import InferenceClient
|
| 4 |
|
| 5 |
+
api_key = os.getenv("HF_API_KEY")
|
| 6 |
client = InferenceClient(api_key=api_key)
|
| 7 |
|
| 8 |
+
user_input = st.text_input('Ask me a question')
|
| 9 |
messages = [
|
| 10 |
{
|
| 11 |
"role": "user",
|
| 12 |
+
"content": user_input
|
| 13 |
}
|
| 14 |
]
|
| 15 |
|