Update app.py
Browse files
app.py
CHANGED
@@ -12,7 +12,7 @@ os.environ['PYTORCH_CUDA_ALLOC_CONF'] = 'max_split_size_mb:25'
|
|
12 |
model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-34B-200K", device_map="auto", torch_dtype="auto", trust_remote_code=True)
|
13 |
tokenizer = YiTokenizer(vocab_file="./tokenizer.model")
|
14 |
|
15 |
-
def run(message, chat_history, max_new_tokens=
|
16 |
prompt = get_prompt(message, chat_history)
|
17 |
|
18 |
# Encode the prompt to tensor
|
@@ -53,9 +53,9 @@ You can also use 🧑🏻🚀YI-200K🚀 by cloning this space. 🧬🔬🔍
|
|
53 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)
|
54 |
"""
|
55 |
|
56 |
-
MAX_MAX_NEW_TOKENS =
|
57 |
-
DEFAULT_MAX_NEW_TOKENS =
|
58 |
-
MAX_INPUT_TOKEN_LENGTH =
|
59 |
|
60 |
def clear_and_save_textbox(message): return '', message
|
61 |
|
@@ -106,7 +106,7 @@ with gr.Blocks(theme='ParityError/Anime') as demo:
|
|
106 |
textbox = gr.Textbox(
|
107 |
container=False,
|
108 |
show_label=False,
|
109 |
-
placeholder='
|
110 |
scale=10
|
111 |
)
|
112 |
submit_button = gr.Button('Submit', variant='primary', scale=1, min_width=0)
|
|
|
12 |
model = AutoModelForCausalLM.from_pretrained("01-ai/Yi-34B-200K", device_map="auto", torch_dtype="auto", trust_remote_code=True)
|
13 |
tokenizer = YiTokenizer(vocab_file="./tokenizer.model")
|
14 |
|
15 |
+
def run(message, chat_history, max_new_tokens=4056, temperature=3.5, top_p=0.9, top_k=800):
|
16 |
prompt = get_prompt(message, chat_history)
|
17 |
|
18 |
# Encode the prompt to tensor
|
|
|
53 |
Join us : 🌟TeamTonic🌟 is always making cool demos! Join our active builder's🛠️community on 👻Discord: [Discord](https://discord.gg/GWpVpekp) On 🤗Huggingface: [TeamTonic](https://huggingface.co/TeamTonic) & [MultiTransformer](https://huggingface.co/MultiTransformer) On 🌐Github: [Polytonic](https://github.com/tonic-ai) & contribute to 🌟 [PolyGPT](https://github.com/tonic-ai/polygpt-alpha)
|
54 |
"""
|
55 |
|
56 |
+
MAX_MAX_NEW_TOKENS = 16000
|
57 |
+
DEFAULT_MAX_NEW_TOKENS = 4056
|
58 |
+
MAX_INPUT_TOKEN_LENGTH = 32000
|
59 |
|
60 |
def clear_and_save_textbox(message): return '', message
|
61 |
|
|
|
106 |
textbox = gr.Textbox(
|
107 |
container=False,
|
108 |
show_label=False,
|
109 |
+
placeholder='As the dawn approached, they leant in and said',
|
110 |
scale=10
|
111 |
)
|
112 |
submit_button = gr.Button('Submit', variant='primary', scale=1, min_width=0)
|