Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,6 +7,15 @@ For more information on `huggingface_hub` Inference API support, please check th
|
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
@spaces.GPU
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def respond(
|
11 |
message,
|
12 |
history: list[tuple[str, str]],
|
@@ -29,6 +38,10 @@ def respond(
|
|
29 |
|
30 |
response = ""
|
31 |
|
|
|
|
|
|
|
|
|
32 |
for message in client.chat_completion(
|
33 |
messages,
|
34 |
max_tokens=max_tokens,
|
|
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
8 |
@spaces.GPU
|
9 |
|
10 |
+
|
11 |
+
if message.strip is False :
|
12 |
+
gr.Warning("you'r message is empty")
|
13 |
+
|
14 |
+
else :
|
15 |
+
continue
|
16 |
+
|
17 |
+
|
18 |
+
|
19 |
def respond(
|
20 |
message,
|
21 |
history: list[tuple[str, str]],
|
|
|
38 |
|
39 |
response = ""
|
40 |
|
41 |
+
if message.strip is False :
|
42 |
+
|
43 |
+
|
44 |
+
|
45 |
for message in client.chat_completion(
|
46 |
messages,
|
47 |
max_tokens=max_tokens,
|