Spaces:
Sleeping
Sleeping
lbtwyk
commited on
Commit
·
2adb71d
1
Parent(s):
e796c83
fix
Browse files
app.py
CHANGED
|
@@ -3,10 +3,20 @@ from pydantic import BaseModel
|
|
| 3 |
from typing import Any, Dict, List, Optional
|
| 4 |
|
| 5 |
import json
|
|
|
|
|
|
|
|
|
|
| 6 |
import torch
|
| 7 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 8 |
from peft import PeftModel
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
from RL.battleground_nl_utils import game_state_to_natural_language
|
| 11 |
|
| 12 |
|
|
|
|
| 3 |
from typing import Any, Dict, List, Optional
|
| 4 |
|
| 5 |
import json
|
| 6 |
+
import sys
|
| 7 |
+
from pathlib import Path
|
| 8 |
+
|
| 9 |
import torch
|
| 10 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 11 |
from peft import PeftModel
|
| 12 |
|
| 13 |
+
ROOT_DIR = Path(__file__).resolve().parent
|
| 14 |
+
RL_DIR = ROOT_DIR / "RL"
|
| 15 |
+
for path in (ROOT_DIR, RL_DIR):
|
| 16 |
+
path_str = str(path)
|
| 17 |
+
if path_str not in sys.path:
|
| 18 |
+
sys.path.append(path_str)
|
| 19 |
+
|
| 20 |
from RL.battleground_nl_utils import game_state_to_natural_language
|
| 21 |
|
| 22 |
|