Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import threading
|
|
4 |
from threading import Event
|
5 |
from typing import Optional
|
6 |
|
|
|
7 |
import datetime
|
8 |
import requests
|
9 |
import discord
|
@@ -48,6 +49,9 @@ async def ai(ctx, *, input_text: str):
|
|
48 |
try:
|
49 |
client = grc.Client("https://wop-xxx-opengpt.hf.space/")
|
50 |
|
|
|
|
|
|
|
51 |
# Asynchronously make the prediction request
|
52 |
prediction_task = asyncio.create_task(client.predict(
|
53 |
input_text,
|
|
|
4 |
from threading import Event
|
5 |
from typing import Optional
|
6 |
|
7 |
+
import asyncio
|
8 |
import datetime
|
9 |
import requests
|
10 |
import discord
|
|
|
49 |
try:
|
50 |
client = grc.Client("https://wop-xxx-opengpt.hf.space/")
|
51 |
|
52 |
+
# Remove leading and trailing whitespace from the input text
|
53 |
+
input_text = input_text.strip()
|
54 |
+
|
55 |
# Asynchronously make the prediction request
|
56 |
prediction_task = asyncio.create_task(client.predict(
|
57 |
input_text,
|