agharsallah commited on
Commit
3ce05f0
Β·
1 Parent(s): ea5af73

update readme

Browse files
Files changed (4) hide show
  1. .env.example +20 -4
  2. .gitattributes +1 -0
  3. README.md +78 -30
  4. app.py +5 -1
.env.example CHANGED
@@ -1,5 +1,21 @@
1
  # Local development environment variables - rename to .env
2
- SAMBANOVA_API_KEY =your_api_key_here
3
- MISTRAL_API_KEY =your_api_key_here
4
- NEBIUS_API_KEY =your_api_key_here
5
- AUDIO_GENERATION_URL =your_api_key_here
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  # Local development environment variables - rename to .env
2
+
3
+ # Used for story generation and text manipulation
4
+ SAMBANOVA_API_KEY="your-sambanova-api-key-here"
5
+ MISTRAL_API_KEY ="your-mistral-api-key-here"
6
+ MISTRAL_MODEL="your-mistral-model-here"
7
+
8
+ # used for image generation models
9
+ NEBIUS_API_KEY="your-nebius-api-key-here"
10
+ NEBIUS_ENDPOINT="your-nebius-endpoint-here"
11
+
12
+ # Replace the URLs with your actual Modal hosted Audio model URLs
13
+ AUDIO_GENERATION_URL="your-audio-generation-url-here"
14
+ MELODY_GENERATION_URL="your-melody-generation-url-here"
15
+
16
+ MCP_SERVER_URL="your-mcp-server-url-here"
17
+
18
+ #Used to test mcp function calling
19
+ OPENAI_API_KEY="your-openai-api-key-here"
20
+ #Used to Parse the PDFs for story enrichment
21
+ LLAMA_CLOUD_API_KEY="your-llama-cloud-api-key-here"
.gitattributes CHANGED
@@ -35,3 +35,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  *.jpg filter=lfs diff=lfs merge=lfs -text
37
  *.png filter=lfs diff=lfs merge=lfs -text
 
 
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
  *.jpg filter=lfs diff=lfs merge=lfs -text
37
  *.png filter=lfs diff=lfs merge=lfs -text
38
+ *.gif filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -1,47 +1,95 @@
1
  ---
2
- title: Dynamic Story Generator
3
- emoji: πŸ“š
4
- colorFrom: indigo
5
- colorTo: purple
6
  sdk: gradio
7
  sdk_version: 5.32.1
8
  app_file: app.py
9
- pinned: false
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
- # Dynamic Story Generator
13
 
14
- This is a Gradio application that generates stories for kids using the SambaNova API. The app allows users to customize stories based on:
15
- - Story type (Historical, Futuristic, Fantasy)
16
- - Tone (Funny, Enthusiastic, Mysterious)
17
- - Child's age
18
- - Language preference
19
- - Child's interests
20
- - Subject of the story
21
- - Optional PDF document for additional context
22
 
23
- ## Setup
24
 
25
- ### Environment Variables
 
 
26
 
27
- The application requires a SambaNova API key which can be provided in two ways:
28
- 1. Through the Gradio web interface in the "API Settings" section
29
- 2. For environment variable check .env.example, and create a `.env` file in the root
30
 
31
- When deploying to Hugging Face Spaces, set this as a Secret in the Settings tab.
32
 
33
- ### Installation
34
 
35
- ```bash
36
- pip install -r requirements.txt
37
- ```
38
 
39
- ### Running Locally
40
 
41
- ```bash
42
- python app.py
43
- ```
44
 
45
- ## Deployment
46
 
47
- This application is designed to work on Hugging Face Spaces. Simply push this repository to a Hugging Face Space and add the `SAMBANOVA_API_KEY` as a Secret in the Space settings.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ title: Magic Tales
3
+ emoji: 🌟
4
+ colorFrom: #e1ebd2
5
+ colorTo: #a7d569
6
  sdk: gradio
7
  sdk_version: 5.32.1
8
  app_file: app.py
9
+ pinned: True
10
+ thumbnail: assets/images/wizard.png
11
+ description: |
12
+ Magic Tales is a Gradio application that uses a range of LLMs and tools to create personalized, immersive stories for children. Customize story types, tones, and more to spark imagination and creativity!
13
+ Track: agent-demo-track
14
+ keywords:
15
+ - gradio
16
+ - Modal
17
+ - Nebius
18
+ - sambanova
19
+ - mistral
20
+ - llamaindex
21
+ - Dia-1.6B
22
+ - Meta musicGen
23
+ - stories
24
+ - children
25
+ - mcp
26
+ - interactive
27
+ - pdf
28
+ - customization
29
+ - imagination
30
+ - creativity
31
+ - agent-demo-track
32
+ - mcp-server-track
33
+ repository: agharsallah/magical-tales
34
  ---
35
 
36
+ # 🌟 Magic Tales: Where Imagination Comes Alive! πŸ“šβœ¨
37
 
38
+ <p align="center">
39
+ <a href="https://huggingface.co/spaces/agharsallah/magical-tales">
40
+ <img src="assets/images/wizard.png" alt="Magic Tales" width="220" style="max-width:100%;height:auto;">
41
+ </a>
42
+ </p>
 
 
 
43
 
44
+ Welcome to Magic Tales, a Gradio application that harnesses the power of SambaNova API to craft personalized, immersive stories for children. Our app is designed to spark imagination and creativity, offering a wide array of customization options to suit various tastes and preferences:
45
 
46
+ πŸ”Ή **Story Crafting**: Choose from diverse story types (Historical, Futuristic, Fantasy), tones (Funny, Enthusiastic, Mysterious), and tailor the narrative based on the child's age, language preference, interests, and the subject of the story.
47
+ πŸ”Ή **Enhanced Context**: Optionally, upload a PDF document to provide additional context for the story, making it even more personalized and relevant.
48
+ πŸ”Ή **Interactive Experience**: Built with Gradio, our application offers an intuitive and interactive user interface, making story generation a delightful experience for both children and parents.
49
 
50
+ ## πŸš€ Getting Started
 
 
51
 
52
+ ### βš™οΈ Configuration
53
 
54
+ You can configure the app using environment variables. For example, to set the SambaNova API key, you can use the `SAMBANOVA_API_KEY` environment variable:
55
 
56
+ - Through the Gradio web interface in the "API Settings" section
57
+ - By creating a `.env` file in the root directory (check `.env.example` for reference)
 
58
 
59
+ When deploying to Hugging Face Spaces, set this as a Secret in the Settings tab.
60
 
61
+ See the [Gradio documentation](https://github.com/gradio-app/gradio/blob/main/guides/04_additional-features/10_environment-variables.md#_snippet_20) for more information.
 
 
62
 
63
+ ### πŸ”§ Setup
64
 
65
+ 1. **Installation**: Run the following command to install the required dependencies:
66
+ ```bash
67
+ pip install -r requirements.txt
68
+ ```
69
+
70
+ 2. **Running Locally**: Start the application by executing:
71
+ ```bash
72
+ python app.py
73
+ ```
74
+
75
+ ## 🎯 Features
76
+
77
+ - **🌎 Multi-Language Support**: Generate stories in various languages to cater to a global audience.
78
+ - **🎢 Audio Narration**: Listen to the generated stories with integrated audio narration for an immersive experience.
79
+ - **🎡 Background Music**: Enjoy background music while listening to the stories, enhancing the overall experience.
80
+ - **🎨 Image Generation**: Generate images to accompany the stories, bringing characters and scenes to life.
81
+ - **πŸ–₯️ Interactive UI**: User-friendly Gradio interface for seamless story generation.
82
+ - **πŸ“„ PDF Context Integration**: Enhance story generation with additional context from uploaded PDF documents.
83
+ - **πŸ“ Customizable Narratives**: Tailor stories based on story type, tone, child's age, language, interests, and subject.
84
+
85
+ ## 🌐 Demo
86
+
87
+ Experience the magic of our Dynamic Story Generator in action! Check out our live demo [here](https://huggingface.co/spaces/agharsallah/magical-tales).
88
+
89
+ ## πŸš€ Deployment
90
+
91
+ This application is optimized for Hugging Face Spaces. Simply push this repository to a Hugging Face Space and add the `SAMBANOVA_API_KEY` as a Secret in the Space settings.
92
+
93
+ ## πŸ“Έ Screenshots
94
+
95
+ ![App Screenshot](assets/demo/magic-story.gif)
app.py CHANGED
@@ -50,7 +50,11 @@ gr.set_static_paths(paths=[Path.cwd().absolute() / "assets/images"])
50
 
51
  def create_app():
52
  """Create the main Gradio app for Magic Story Creator"""
53
- with gr.Blocks(css=main_css, theme=gr.themes.Ocean()) as demo:
 
 
 
 
54
  # Header
55
  create_header()
56
 
 
50
 
51
  def create_app():
52
  """Create the main Gradio app for Magic Story Creator"""
53
+ with gr.Blocks(
54
+ css=main_css,
55
+ theme=gr.themes.Ocean(),
56
+ title="Magic Tales",
57
+ ) as demo:
58
  # Header
59
  create_header()
60