Spaces:
Sleeping
Sleeping
gospacedev
commited on
Commit
•
93baf69
1
Parent(s):
a93bafe
update filtered output
Browse files
app.py
CHANGED
@@ -23,7 +23,15 @@ def generate_translation(prompt):
|
|
23 |
output = ""
|
24 |
emoji_pattern = r"[^\u0021-\u007E\u00A0-\uD7FF\uE000-\uFDCF\uFF00-\uFFEF\u10000-\u10FFFF\u0300-\u036F\u1F00-\u1F1F\u1F20-\u1F7F\u2600-\u26FF\u2700-\u27BF]+?"
|
25 |
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
|
29 |
|
|
|
23 |
output = ""
|
24 |
emoji_pattern = r"[^\u0021-\u007E\u00A0-\uD7FF\uE000-\uFDCF\uFF00-\uFFEF\u10000-\u10FFFF\u0300-\u036F\u1F00-\u1F1F\u1F20-\u1F7F\u2600-\u26FF\u2700-\u27BF]+?"
|
25 |
|
26 |
+
for response in stream:
|
27 |
+
output += response.token.text
|
28 |
+
yield output
|
29 |
+
|
30 |
+
filtered_output = re.findall(emoji_pattern, output)
|
31 |
+
|
32 |
+
return ''.join(filtered_output)
|
33 |
+
|
34 |
+
|
35 |
|
36 |
|
37 |
|