Spaces:
Sleeping
Sleeping
NeonBohdan
commited on
Commit
•
4bb483c
1
Parent(s):
2e517b5
No revision -> no personas
Browse files
shared.py
CHANGED
@@ -68,14 +68,16 @@ class Client:
|
|
68 |
self.revision = revision
|
69 |
|
70 |
def get_personas(self):
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
79 |
|
80 |
personas["default"] = None
|
81 |
self.personas = self.input_personas | personas
|
|
|
68 |
self.revision = revision
|
69 |
|
70 |
def get_personas(self):
|
71 |
+
personas = {}
|
72 |
+
if self.revision is not None:
|
73 |
+
try:
|
74 |
+
config_path = hf_hub_download(self.model_name, "config.yaml",
|
75 |
+
subfolder="datasets",
|
76 |
+
revision=self.revision)
|
77 |
+
self.config = ModelConfig.from_yaml(config_path)
|
78 |
+
personas = self.config.pile.persona2system
|
79 |
+
except EntryNotFoundError:
|
80 |
+
pass
|
81 |
|
82 |
personas["default"] = None
|
83 |
self.personas = self.input_personas | personas
|