Spaces:
Sleeping
Sleeping
Define load world function
Browse files
helper.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
# Add your utilities or helper functions to this file.
|
| 2 |
import os
|
| 3 |
-
from dotenv import load_dotenv, find_dotenv
|
| 4 |
import json
|
|
|
|
| 5 |
from together import Together
|
| 6 |
|
| 7 |
def load_env():
|
|
@@ -17,4 +17,9 @@ def save_world(world, filename):
|
|
| 17 |
|
| 18 |
def get_together_api_key():
|
| 19 |
load_env()
|
| 20 |
-
return os.getenv("TOGETHER_API_KEY")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Add your utilities or helper functions to this file.
|
| 2 |
import os
|
|
|
|
| 3 |
import json
|
| 4 |
+
from dotenv import load_dotenv, find_dotenv
|
| 5 |
from together import Together
|
| 6 |
|
| 7 |
def load_env():
|
|
|
|
| 17 |
|
| 18 |
def get_together_api_key():
|
| 19 |
load_env()
|
| 20 |
+
return os.getenv("TOGETHER_API_KEY")
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def load_world(filename):
|
| 24 |
+
with open(filename, 'r') as f:
|
| 25 |
+
return json.load(f)
|