NursNurs commited on
Commit
6005918
1 Parent(s): 20813ef
Files changed (2) hide show
  1. apps.py +36 -0
  2. requirements.txt +1 -0
apps.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Import from 3rd party libraries
2
+ import streamlit as st
3
+ import streamlit.components.v1 as components
4
+ # import streamlit_analytics
5
+
6
+
7
+ # with text_spinner_placeholder:
8
+ # with st.spinner("Please wait while your Tweet is being generated..."):
9
+ # mood_prompt = f"{mood} " if mood else ""
10
+ # if style:
11
+ # twitter = twe.Tweets(account=style)
12
+ # tweets = twitter.fetch_tweets()
13
+ # tweets_prompt = "\n\n".join(tweets)
14
+ # prompt = (
15
+ # f"Write a {mood_prompt}Tweet about {topic} in less than 120 characters "
16
+ # f"and in the style of the following Tweets:\n\n{tweets_prompt}\n\n"
17
+
18
+ # Configure Streamlit page and state
19
+ st.set_page_config(page_title="Tweet", page_icon="🤖")
20
+
21
+ st.title("Generate Tweets")
22
+ st.markdown(
23
+ "This mini-app predicts a mental disorder based on your description."
24
+ )
25
+
26
+ topic = st.text_input(label="Topic (or hashtag)", placeholder="AI")
27
+ mood = st.text_input(
28
+ label="Mood (e.g. inspirational, funny, serious) (optional)",
29
+ placeholder="inspirational",
30
+ )
31
+ style = st.text_input(
32
+ label="Twitter account handle to style-copy recent Tweets (optional, limited by Twitter's API)",
33
+ placeholder="elonmusk",
34
+ )
35
+
36
+ text_spinner_placeholder = st.empty()
requirements.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ streamlit==1.26.0