Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,18 +1,15 @@
|
|
1 |
-
# !pip install
|
2 |
-
|
3 |
-
|
4 |
from pyChatGPT import ChatGPT
|
5 |
import os
|
6 |
-
|
7 |
# refresh the authorization token
|
8 |
-
|
9 |
|
10 |
def chat_hf(text,session_tokenz):
|
11 |
|
12 |
|
13 |
try:
|
14 |
|
15 |
-
|
16 |
api = ChatGPT(session_token)
|
17 |
resp = api.send_message(text)
|
18 |
|
|
|
|
|
|
|
|
|
1 |
from pyChatGPT import ChatGPT
|
2 |
import os
|
3 |
+
os.environ["SessionToken"] = SessionToken
|
4 |
# refresh the authorization token
|
5 |
+
session_token = os.environ.get('SessionToken')
|
6 |
|
7 |
def chat_hf(text,session_tokenz):
|
8 |
|
9 |
|
10 |
try:
|
11 |
|
12 |
+
|
13 |
api = ChatGPT(session_token)
|
14 |
resp = api.send_message(text)
|
15 |
|