Spaces:
Sleeping
Sleeping
wwydmanski
commited on
Commit
•
6a7874b
1
Parent(s):
df06262
Update app.py
Browse files
app.py
CHANGED
@@ -46,23 +46,22 @@ sample_code = """
|
|
46 |
client = Client("https://wwydmanski-esmfold.hf.space/")
|
47 |
|
48 |
def fold_huggingface(sequence, fname=None):
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
pdb_fname = fold_huggingface("MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN")
|
65 |
-
|
66 |
"""
|
67 |
|
68 |
tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1")
|
|
|
46 |
client = Client("https://wwydmanski-esmfold.hf.space/")
|
47 |
|
48 |
def fold_huggingface(sequence, fname=None):
|
49 |
+
result = client.predict(
|
50 |
+
sequence, # str in 'sequence' Textbox component
|
51 |
+
api_name="/predict")
|
52 |
+
result = eval(result)[0]
|
53 |
+
if fname is None:
|
54 |
+
with tempfile.NamedTemporaryFile("w", delete=False, suffix=".pdb", prefix="esmfold_") as fp:
|
55 |
+
fp.write(result)
|
56 |
+
fp.flush()
|
57 |
+
return fp.name
|
58 |
+
else:
|
59 |
+
with open(fname, "w") as fp:
|
60 |
+
fp.write(result)
|
61 |
+
fp.flush()
|
62 |
+
return fname
|
|
|
63 |
pdb_fname = fold_huggingface("MALWMRLLPLLALLALWGPDPAAAFVNQHLCGSHLVEALYLVCGERGFFYTPKTRREAEDLQVGQVELGGGPGAGSLQPLALEGSLQKRGIVEQCCTSICSLYQLENYCN")
|
64 |
+
|
65 |
"""
|
66 |
|
67 |
tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1")
|