Spaces:
Runtime error
Runtime error
MudassirFayaz
commited on
Commit
•
6f56570
1
Parent(s):
bbac6e8
myapp
Browse files
app.py
ADDED
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import requests
|
3 |
+
|
4 |
+
# API details
|
5 |
+
API_URL = "https://api-inference.huggingface.co/models/MudassirFayaz/career_councling_using_bart"
|
6 |
+
headers = {"Authorization": "Bearer "}
|
7 |
+
|
8 |
+
|
9 |
+
def query(payload):
|
10 |
+
response = requests.post(API_URL, headers=headers, json=payload)
|
11 |
+
return response.json()
|
12 |
+
|
13 |
+
# Streamlit app
|
14 |
+
st.title("Career Counseling using BART")
|
15 |
+
st.write("Enter a prompt and get a response from the BART model for career counseling.")
|
16 |
+
|
17 |
+
# User input
|
18 |
+
user_input = st.text_area("Enter your prompt here:", "The answer to the universe is")
|
19 |
+
|
20 |
+
if st.button("Get Response"):
|
21 |
+
with st.spinner("Querying the API..."):
|
22 |
+
output = query({"inputs": user_input})
|
23 |
+
st.success("Response received!")
|
24 |
+
st.write("**Output:**", output)
|