multi search and duplication update
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ class PDBSearchAssistant:
|
|
32 |
max_new_tokens=1024,
|
33 |
temperature=0.1,
|
34 |
torch_dtype="auto",
|
35 |
-
device="
|
36 |
)
|
37 |
|
38 |
self.prompt_template = """
|
@@ -339,9 +339,10 @@ class PDBSearchAssistant:
|
|
339 |
|
340 |
if len(queries) > 2:
|
341 |
print("Combining with additional queries using AND")
|
342 |
-
final_query =
|
343 |
-
|
344 |
-
|
|
|
345 |
else:
|
346 |
final_query = protein_queries
|
347 |
else:
|
@@ -620,6 +621,8 @@ def render_html(pdb_id, chain_count):
|
|
620 |
|
621 |
def create_interactive_table(df):
|
622 |
# Reorder columns - Add '# of atoms of protein' to the column order
|
|
|
|
|
623 |
column_order = ['PDB ID', 'Resolution', 'Title','# of total residues', '# of atoms of protein', 'Method','Release Date']
|
624 |
df = df[column_order]
|
625 |
|
|
|
32 |
max_new_tokens=1024,
|
33 |
temperature=0.1,
|
34 |
torch_dtype="auto",
|
35 |
+
device="cpu" # cuda or cpu
|
36 |
)
|
37 |
|
38 |
self.prompt_template = """
|
|
|
339 |
|
340 |
if len(queries) > 2:
|
341 |
print("Combining with additional queries using AND")
|
342 |
+
final_query = queries[0] & queries[1]
|
343 |
+
# final_query = protein_queries
|
344 |
+
# for q in queries[2:]:
|
345 |
+
# final_query = final_query & q
|
346 |
else:
|
347 |
final_query = protein_queries
|
348 |
else:
|
|
|
621 |
|
622 |
def create_interactive_table(df):
|
623 |
# Reorder columns - Add '# of atoms of protein' to the column order
|
624 |
+
df = df.drop_duplicates()
|
625 |
+
|
626 |
column_order = ['PDB ID', 'Resolution', 'Title','# of total residues', '# of atoms of protein', 'Method','Release Date']
|
627 |
df = df[column_order]
|
628 |
|