Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
16 |
|
17 |
DESCRIPTION = """\
|
18 |
# ✨Storytell AI🧑🏽💻
|
19 |
-
Welcome to the **Storytell AI** space, crafted with care by Ranam & George. Dive into the world of educational storytelling with our [Storytell](https://huggingface.co/ranamhamoud/storytell) model. This iteration of the Llama 2 model with 7 billion parameters is fine-tuned to generate educational stories that engage and educate. Enjoy a journey of discovery and creativity—your storytelling lesson begins here!
|
20 |
"""
|
21 |
|
22 |
|
@@ -51,16 +51,16 @@ class Story(Document):
|
|
51 |
story_id = SequenceField(primary_key=True)
|
52 |
|
53 |
def make_prompt(entry):
|
54 |
-
return f"TELL A STORY,RELATE TO COMPUTER SCIENCE,INCLUDE
|
55 |
|
56 |
@spaces.GPU
|
57 |
def generate(
|
58 |
message: str,
|
59 |
chat_history: list[tuple[str, str]],
|
60 |
max_new_tokens: int = 1024,
|
61 |
-
temperature: float = 0.
|
62 |
-
top_p: float = 0.
|
63 |
-
top_k: int =
|
64 |
repetition_penalty: float = 1.0,
|
65 |
) -> Iterator[str]:
|
66 |
conversation = []
|
@@ -108,7 +108,8 @@ chat_interface = gr.ChatInterface(
|
|
108 |
stop_btn=None,
|
109 |
examples=[
|
110 |
["Can you explain briefly to me what is the Python programming language?"],
|
111 |
-
["Could you please provide an explanation about the concept of recursion?"]
|
|
|
112 |
],
|
113 |
)
|
114 |
|
|
|
16 |
|
17 |
DESCRIPTION = """\
|
18 |
# ✨Storytell AI🧑🏽💻
|
19 |
+
Welcome to the **Storytell AI** space, crafted with care by Ranam & George. Dive into the world of educational storytelling with our [Storytell](https://huggingface.co/ranamhamoud/storytell) model. This iteration of the Llama 2 model with 7 billion parameters is fine-tuned to generate educational stories that engage and educate. Enjoy a journey of discovery and creativity—your storytelling lesson begins here! You can prompt this model to explain any computer science concept. **Please check the examples below**.
|
20 |
"""
|
21 |
|
22 |
|
|
|
51 |
story_id = SequenceField(primary_key=True)
|
52 |
|
53 |
def make_prompt(entry):
|
54 |
+
return f"TELL A STORY,RELATE TO COMPUTER SCIENCE,INCLUDE ASSESMENTS. MAKE IT REALISTIC AND AROUND 800 WORDS: {entry} "
|
55 |
|
56 |
@spaces.GPU
|
57 |
def generate(
|
58 |
message: str,
|
59 |
chat_history: list[tuple[str, str]],
|
60 |
max_new_tokens: int = 1024,
|
61 |
+
temperature: float = 0.1,
|
62 |
+
top_p: float = 0.6,
|
63 |
+
top_k: int = 20,
|
64 |
repetition_penalty: float = 1.0,
|
65 |
) -> Iterator[str]:
|
66 |
conversation = []
|
|
|
108 |
stop_btn=None,
|
109 |
examples=[
|
110 |
["Can you explain briefly to me what is the Python programming language?"],
|
111 |
+
["Could you please provide an explanation about the concept of recursion?"],
|
112 |
+
["Could you explain what a URL is?"]
|
113 |
],
|
114 |
)
|
115 |
|