Update run.py
Browse files
run.py
CHANGED
@@ -8,6 +8,16 @@ from oauth2client.service_account import ServiceAccountCredentials
|
|
8 |
from datetime import datetime
|
9 |
from google.oauth2 import service_account
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
# Google Sheets setup
|
12 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
13 |
key1 = os.getenv("key1")
|
@@ -90,7 +100,7 @@ def format_prompt(message, history):
|
|
90 |
print("HISTORY")
|
91 |
print(history)
|
92 |
prompt = "" #"<s>"
|
93 |
-
|
94 |
for user_prompt, bot_response in history:
|
95 |
if c<2:
|
96 |
prompt += f"[INST] {user_prompt} [/INST]"
|
|
|
8 |
from datetime import datetime
|
9 |
from google.oauth2 import service_account
|
10 |
|
11 |
+
import socket
|
12 |
+
|
13 |
+
def get_local_ip():
|
14 |
+
"""Get the local IP address."""
|
15 |
+
hostname = socket.gethostname()
|
16 |
+
local_ip = socket.gethostbyname(hostname)
|
17 |
+
print("IP______________________")
|
18 |
+
print(local_ip)
|
19 |
+
return local_ip
|
20 |
+
|
21 |
# Google Sheets setup
|
22 |
scope = ["https://spreadsheets.google.com/feeds", "https://www.googleapis.com/auth/drive"]
|
23 |
key1 = os.getenv("key1")
|
|
|
100 |
print("HISTORY")
|
101 |
print(history)
|
102 |
prompt = "" #"<s>"
|
103 |
+
c=1
|
104 |
for user_prompt, bot_response in history:
|
105 |
if c<2:
|
106 |
prompt += f"[INST] {user_prompt} [/INST]"
|