stephenmccartney1234 commited on
Commit
af56ee5
·
1 Parent(s): 0859c89

Upload 4 files

Browse files
Files changed (3) hide show
  1. README.md +5 -5
  2. app.py +33 -0
  3. requirements.txt +2 -0
README.md CHANGED
@@ -1,10 +1,10 @@
1
  ---
2
- title: OpenAdjusterBot
3
- emoji: 🐢
4
- colorFrom: yellow
5
- colorTo: green
6
  sdk: gradio
7
- sdk_version: 3.29.0
8
  app_file: app.py
9
  pinned: false
10
  ---
 
1
  ---
2
+ title: Astroteabot
3
+ emoji: 🐠
4
+ colorFrom: blue
5
+ colorTo: yellow
6
  sdk: gradio
7
+ sdk_version: 3.27.0
8
  app_file: app.py
9
  pinned: false
10
  ---
app.py ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import openai
3
+ openai.api_key = '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'
4
+
5
+ def generate_text(prompt):
6
+ # Add custom text to the prompt
7
+ input_text = prompt + "You are an expert and enthusiastic astrologer and I want you to please use my birthdate and place of birth to write my horoscope. In this horoscope consider the movements of the celestial bodies and the houses they are in for the particular individual based off of their date and location of birth. The readings you write are only three sentences long. They are accurate, but written in a fun and personal style. Please write the horroscope in 3 sentences. In the first sentence you give an insightful overview of their character based off of their sun and moon signs at birth. In your second sentence you explain the most recent movement and how this may affect how they are feeling. In your third sentence you explain why they are feeling this way and suggest examples of how this may be affecting their life. At the end of the horroscope link the persons horroscope to a custom and luxury teamix you are selling. Do this by beginning the next sentence with 'For you, we would recommend' emphasising that the blend is custom made for them to help them with their needs. You should determine what ingredients the teamix contains based on the compatibility and potential helpfulness of the ingredients health benefits and taste with the reading you gave, then write 2 sentences. In the first sentence describe the taste and health benefits of the main ingredients and what flavour and health benefits this gives the teamix. In the second sentence explain how the taste and health benefits of the teamix relate to their personality and feelings from the horoscope and how they are perfect for the person."
8
+ # Generate text using OpenAI API
9
+ response = openai.Completion.create(
10
+ engine="text-davinci-002",
11
+ prompt=input_text,
12
+ max_tokens=1024,
13
+ n=1,
14
+ stop=None,
15
+ temperature=0.7
16
+ )
17
+
18
+ # Return the generated text
19
+ return response.choices[0].text.strip()
20
+
21
+ # Define the input and output interfaces using Gradio
22
+ input_text = gr.inputs.Textbox(label="Please enter your date of Birth and where you were born")
23
+ output_text = gr.outputs.Textbox(label="Generated text:")
24
+
25
+ # Create the Gradio app and run it
26
+ gradio_app = gr.Interface(
27
+ fn=generate_text,
28
+ inputs=input_text,
29
+ outputs=output_text,
30
+ title="AstrologyBot",
31
+ description="An AI Bot that works out your horroscope and tea recommendations"
32
+ )
33
+ gradio_app.launch()
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ OpenAI
2
+ gradio==3.27.0