File size: 1,811 Bytes
dbe9ae4
b5db58b
dbe9ae4
 
 
16b2878
dbe9ae4
 
 
 
 
7892c4e
dbe9ae4
 
 
 
b5db58b
 
 
16b2878
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b5db58b
16b2878
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import os
import requests
from io import BytesIO
import base64
import streamlit as st
import requests

AUTH_TOKEN = st. secrets["AUTH_TOKEN"]

headers = {"Authorization": f"Bearer {AUTH_TOKEN}"}
st.set_page_config(page_title="Image Similarity", page_icon="πŸŽ†πŸŽ‡")
CHAT_API = "https://abhilashvj-chat-api.hf.space/"
# IMAGE_SIMILARITY_DEMO = "http://127.0.0.1:8000/find-similar-image-pinecone/"
TMP_DIR = "./tmp"

os.makedirs(TMP_DIR, exist_ok=True)



st.title("Resume Reframing App")

# Uploading files using Streamlit
resume_file = st.file_uploader("Upload Resume", type=["txt", "pdf"])
template_file = st.file_uploader("Upload Template (Optional)", type=["txt", "pdf"], accept_multiple_files=False)
job_description_file = st.file_uploader("Upload Job Description (Optional)", type=["txt", "pdf"], accept_multiple_files=False)

# Inputs for QueryData
text_input = st.text_input("Enter your text:", "Your text here")
top_k = st.number_input("Top K", min_value=1, max_value=100, value=5)
primer = st.text_input("Enter primer:", "Your primer here")

if st.button("Submit"):
    if resume_file:
        # The URL to your FastAPI endpoint
        url = f"{CHAT_API}/upload/"

        # Setting up the data for the `QueryData` model
        data = {
            "text": text_input,
            "top_k": top_k,
            "primer": primer,
        }

        files = {"resume": resume_file.getvalue()}

        if template_file:
            files["template"] = template_file.getvalue()

        if job_description_file:
            files["job_description"] = job_description_file.getvalue()

        # Making the POST request
        response = requests.post(url, data=data, files=files)

        # Displaying the response
        st.write(response.json())
    else:
        st.warning("Please upload a resume!")