Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -111,7 +111,10 @@ if prompt := st.chat_input(f"Hi I'm {selected_model}, How can I help you today?"
|
|
111 |
"ModernMigrate⭐": 8192,
|
112 |
"RetroRecode🔄": 4096
|
113 |
}
|
114 |
-
|
|
|
|
|
|
|
115 |
|
116 |
with st.chat_message("assistant"):
|
117 |
client = InferenceClient(
|
|
|
111 |
"ModernMigrate⭐": 8192,
|
112 |
"RetroRecode🔄": 4096
|
113 |
}
|
114 |
+
|
115 |
+
# Calculate available tokens for new content
|
116 |
+
input_tokens = len(formated_text.split())
|
117 |
+
max_new_tokens = max(0, max_tokens[selected_model] - input_tokens)
|
118 |
|
119 |
with st.chat_message("assistant"):
|
120 |
client = InferenceClient(
|