Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,8 +23,8 @@ Welcome to the **Storytell AI** space, crafted with care by Ranam & George. Dive
|
|
| 23 |
LICENSE = """
|
| 24 |
<p/>
|
| 25 |
---
|
| 26 |
-
|
| 27 |
-
|
| 28 |
"""
|
| 29 |
|
| 30 |
if not torch.cuda.is_available():
|
|
@@ -51,16 +51,16 @@ class Story(Document):
|
|
| 51 |
story_id = SequenceField(primary_key=True)
|
| 52 |
|
| 53 |
def make_prompt(entry):
|
| 54 |
-
return f"### Human:
|
| 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.2,
|
| 65 |
|
| 66 |
) -> Iterator[str]:
|
|
|
|
| 23 |
LICENSE = """
|
| 24 |
<p/>
|
| 25 |
---
|
| 26 |
+
As a derivate work of [Llama-2-7b-chat](https://huggingface.co/meta-llama/Llama-2-7b-chat) by Meta,
|
| 27 |
+
this demo is governed by the original [license](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat/blob/main/LICENSE.txt) and [acceptable use policy](https://huggingface.co/spaces/huggingface-projects/llama-2-7b-chat/blob/main/USE_POLICY.md).
|
| 28 |
"""
|
| 29 |
|
| 30 |
if not torch.cuda.is_available():
|
|
|
|
| 51 |
story_id = SequenceField(primary_key=True)
|
| 52 |
|
| 53 |
def make_prompt(entry):
|
| 54 |
+
return f"### Human:YOUR INSTRUCTION HERE,ALWAYS USE A STORY,RELATE TO COMPUTER SCIENCE, INCLUDE ASSESMENTS AND A TECHNICAL SUMMARY: {entry} ### Assistant:"
|
| 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.4,
|
| 62 |
+
top_p: float = 0.6,
|
| 63 |
+
top_k: int = 20,
|
| 64 |
repetition_penalty: float = 1.2,
|
| 65 |
|
| 66 |
) -> Iterator[str]:
|