Spaces:
Runtime error
Runtime error
Commit ·
3495b76
1
Parent(s): 6dc8722
Upload st.py
Browse files
st.py
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
+
import os
|
| 3 |
+
import openai
|
| 4 |
+
|
| 5 |
+
openai.api_key = "sk-K6MDFs6eSvvsV2to5OXS3KRKgQA7qPnnuq8rGqhM"
|
| 6 |
+
|
| 7 |
+
|
| 8 |
+
|
| 9 |
+
st.sidebar.title('LinkedIn Helper ')
|
| 10 |
+
st.sidebar.text("@ your service")
|
| 11 |
+
st.sidebar.title('Page Selection Menu')
|
| 12 |
+
page = st.sidebar.radio("Select Required Feature",("Headline Generator","Bio Generator"))
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
if page=='Headline Generator':
|
| 16 |
+
st.title('LinkedIn Headline Generator')
|
| 17 |
+
description = st.text_area("Enter your description",'')
|
| 18 |
+
|
| 19 |
+
if st.button("Generate Headline!"):
|
| 20 |
+
if description=="":
|
| 21 |
+
st.error("Please enter your description")
|
| 22 |
+
else:
|
| 23 |
+
with st.spinner("Fetching response..."):
|
| 24 |
+
response = openai.Completion.create(
|
| 25 |
+
engine="davinci-instruct-beta",
|
| 26 |
+
prompt= f"An application to create a LinkedIn headline from the given description.\n\nI am a technologist, IT leader, lecturer, and cook. I provide fractional CTO and CIO services to technology startups, helping them find the right direction for their business. I deliver talks on topics such as blockchain and cryptography to a wide variety of audiences including as a guest lecturer at the Haas School of Business.\n\nLinkedIn headline:\nBlockchain expert and lecturer. Fractional CTO/CIO services to tech startups.\n\nI am an innovative entrepreneur with more than 11 years of experience in the digital marketing, technology and service industries. I am an active member of the startup community and have founded a couple of startups and exited one of them.\n\nLinkedIn headline:\nEntrepreneur, Digital Marketing Expert, Investor, Mentor, Public Speaker, Blockchain and Cryptocurrency Expert.\n\nI am a student entrepreneur. I have created many projects in the fields of app development, python automation and machine learning. Am also a Data Science enthusiast and I wish to get a job in this field.\n\nLinkedIn headline:\nStudent Entrepreneur, Machine Learning Enthusiast, Data Science Enthusiast.\n\n{description} \n\nLinkedIn headline:\n",
|
| 27 |
+
temperature=1,
|
| 28 |
+
max_tokens=100,
|
| 29 |
+
top_p=1,
|
| 30 |
+
frequency_penalty=0,
|
| 31 |
+
presence_penalty=0.6
|
| 32 |
+
)
|
| 33 |
+
st.markdown(response['choices'][0]['text'])
|
| 34 |
+
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
elif page=='Bio Generator':
|
| 38 |
+
st.title('LinkedIn Bio Generator')
|
| 39 |
+
description = st.text_area("Enter your Headline",'')
|
| 40 |
+
|
| 41 |
+
if st.button("Generate Bio!"):
|
| 42 |
+
if description=="":
|
| 43 |
+
st.error("Please enter your headline")
|
| 44 |
+
else:
|
| 45 |
+
with st.spinner("Fetching response..."):
|
| 46 |
+
response = openai.Completion.create(
|
| 47 |
+
engine="davinci-instruct-beta",
|
| 48 |
+
prompt= f"An application to create a description from the given LinkedIn headlines.\n###\nHeadline: \nBlockchain expert and lecturer. Fractional CTO/CIO services to tech startups.\n\nLinkedIn description:\nI am a technologist, IT leader, lecturer, and cook. I provide fractional CTO and CIO services to technology startups, helping them find the right direction for their business. I deliver talks on topics such as blockchain and cryptography to a wide variety of audiences including as a guest lecturer at the Haas School of Business.\n###\nHeadline: \nEntrepreneur, Digital Marketing Expert, Investor, Mentor, Public Speaker, Blockchain and Cryptocurrency Expert.\n\nLinkedIn description:\nI am an innovative entrepreneur with more than 11 years of experience in the digital marketing, technology and service industries. I am an active member of the startup community and have founded a couple of startups and exited one of them.\n###\nHeadline: \nStudent Entrepreneur, Machine Learning Enthusiast, Data Science Enthusiast.\n\nLinkedIn description:\nI am a student entrepreneur. I have created many projects in the fields of app development, python automation and machine learning. Am also a Data Science enthusiast and I wish to get a job in this field.\n###\nHeadline:\nE-commerce Marketing and Brand Relationship Manager at Adanola. Single point of contact skill set to drive growth.\n\nLinkedIn description:\nI am a e-commerce marketing and brand relationship manager who has a wide set of skills. I drive growth for brands, managing both online and offline marketing channels such as SEO, inbound marketing, SEM, PPC, content marketing, email campaigns, and social media. I love what I do and I hope that the career I have right now will be a great stepping stone for me.\n###\nHeadline:\n{description}\n\nLinkedIn description:",
|
| 49 |
+
temperature=0.8,
|
| 50 |
+
max_tokens=100,
|
| 51 |
+
top_p=1,
|
| 52 |
+
frequency_penalty=0,
|
| 53 |
+
presence_penalty=0,
|
| 54 |
+
stop=["###"]
|
| 55 |
+
)
|
| 56 |
+
st.markdown(response['choices'][0]['text'])
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
|