Spaces:
Runtime error
Runtime error
Commit
·
b6035c5
0
Parent(s):
Duplicate from stephenmccartney1234/astroteabot
Browse files- .gitattributes +34 -0
- README.md +13 -0
- app.py +33 -0
- requirements.txt +2 -0
.gitattributes
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
*.7z filter=lfs diff=lfs merge=lfs -text
|
| 2 |
+
*.arrow filter=lfs diff=lfs merge=lfs -text
|
| 3 |
+
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 4 |
+
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
*.ckpt filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
*.ftz filter=lfs diff=lfs merge=lfs -text
|
| 7 |
+
*.gz filter=lfs diff=lfs merge=lfs -text
|
| 8 |
+
*.h5 filter=lfs diff=lfs merge=lfs -text
|
| 9 |
+
*.joblib filter=lfs diff=lfs merge=lfs -text
|
| 10 |
+
*.lfs.* filter=lfs diff=lfs merge=lfs -text
|
| 11 |
+
*.mlmodel filter=lfs diff=lfs merge=lfs -text
|
| 12 |
+
*.model filter=lfs diff=lfs merge=lfs -text
|
| 13 |
+
*.msgpack filter=lfs diff=lfs merge=lfs -text
|
| 14 |
+
*.npy filter=lfs diff=lfs merge=lfs -text
|
| 15 |
+
*.npz filter=lfs diff=lfs merge=lfs -text
|
| 16 |
+
*.onnx filter=lfs diff=lfs merge=lfs -text
|
| 17 |
+
*.ot filter=lfs diff=lfs merge=lfs -text
|
| 18 |
+
*.parquet filter=lfs diff=lfs merge=lfs -text
|
| 19 |
+
*.pb filter=lfs diff=lfs merge=lfs -text
|
| 20 |
+
*.pickle filter=lfs diff=lfs merge=lfs -text
|
| 21 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
| 22 |
+
*.pt filter=lfs diff=lfs merge=lfs -text
|
| 23 |
+
*.pth filter=lfs diff=lfs merge=lfs -text
|
| 24 |
+
*.rar filter=lfs diff=lfs merge=lfs -text
|
| 25 |
+
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 26 |
+
saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
| 27 |
+
*.tar.* filter=lfs diff=lfs merge=lfs -text
|
| 28 |
+
*.tflite filter=lfs diff=lfs merge=lfs -text
|
| 29 |
+
*.tgz filter=lfs diff=lfs merge=lfs -text
|
| 30 |
+
*.wasm filter=lfs diff=lfs merge=lfs -text
|
| 31 |
+
*.xz filter=lfs diff=lfs merge=lfs -text
|
| 32 |
+
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 33 |
+
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 34 |
+
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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 |
+
duplicated_from: stephenmccartney1234/astroteabot
|
| 11 |
+
---
|
| 12 |
+
|
| 13 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
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
|