Spaces:
Build error
Build error
test lists
Browse files- app.py +5 -7
- temp_showcase_model.py +0 -93
app.py
CHANGED
|
@@ -4,7 +4,6 @@ import streamlit_pydantic as sp
|
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
|
| 6 |
from src.Surveyor import Surveyor
|
| 7 |
-
from temp_showcase_model import ShowcaseModel
|
| 8 |
|
| 9 |
|
| 10 |
|
|
@@ -56,8 +55,8 @@ class KeywordsModel(BaseModel):
|
|
| 56 |
|
| 57 |
|
| 58 |
class ArxivIDsModel(BaseModel):
|
| 59 |
-
arxiv_ids: Optional[
|
| 60 |
-
|
| 61 |
)
|
| 62 |
|
| 63 |
|
|
@@ -74,8 +73,9 @@ def survey_space(surveyor, download_placeholder):
|
|
| 74 |
run_kwargs.update({'research_keywords':session_data['research_keywords'],
|
| 75 |
'max_search':session_data['research_keywords'],
|
| 76 |
'num_papers':session_data['research_keywords']})
|
| 77 |
-
elif
|
| 78 |
-
run_kwargs.update({'arxiv_ids':session_data['arxiv_ids']})
|
|
|
|
| 79 |
run_survey(**run_kwargs)
|
| 80 |
|
| 81 |
'''
|
|
@@ -112,8 +112,6 @@ def survey_space(surveyor, download_placeholder):
|
|
| 112 |
|
| 113 |
if __name__ == '__main__':
|
| 114 |
st.title('Auto-Research V0.1 - Automated Survey generation from research keywords')
|
| 115 |
-
with st.sidebar.form(key="dummy_form"):
|
| 116 |
-
dummy_session_data = sp.pydantic_input(key="dummy_model", model=ShowcaseModel)
|
| 117 |
std_col, survey_col = st.columns(2)
|
| 118 |
std_col.header('execution log:')
|
| 119 |
survey_col.header('Generated_survey:')
|
|
|
|
| 4 |
from pydantic import BaseModel, Field
|
| 5 |
|
| 6 |
from src.Surveyor import Surveyor
|
|
|
|
| 7 |
|
| 8 |
|
| 9 |
|
|
|
|
| 55 |
|
| 56 |
|
| 57 |
class ArxivIDsModel(BaseModel):
|
| 58 |
+
arxiv_ids: Optional[str] = Field(
|
| 59 |
+
'', description="Enter comma_separated arxiv ids for your curated set of papers (e.g. 2205.12755, 2205.10937, ...):"
|
| 60 |
)
|
| 61 |
|
| 62 |
|
|
|
|
| 73 |
run_kwargs.update({'research_keywords':session_data['research_keywords'],
|
| 74 |
'max_search':session_data['research_keywords'],
|
| 75 |
'num_papers':session_data['research_keywords']})
|
| 76 |
+
elif session_data['arxiv_ids'] != '':
|
| 77 |
+
run_kwargs.update({'arxiv_ids':[id.strip() for id in session_data['arxiv_ids'].split(',')]})
|
| 78 |
+
st.json(run_kwargs)
|
| 79 |
run_survey(**run_kwargs)
|
| 80 |
|
| 81 |
'''
|
|
|
|
| 112 |
|
| 113 |
if __name__ == '__main__':
|
| 114 |
st.title('Auto-Research V0.1 - Automated Survey generation from research keywords')
|
|
|
|
|
|
|
| 115 |
std_col, survey_col = st.columns(2)
|
| 116 |
std_col.header('execution log:')
|
| 117 |
survey_col.header('Generated_survey:')
|
temp_showcase_model.py
DELETED
|
@@ -1,93 +0,0 @@
|
|
| 1 |
-
import datetime
|
| 2 |
-
from enum import Enum
|
| 3 |
-
from typing import Dict, List, Literal, Optional, Set
|
| 4 |
-
|
| 5 |
-
import streamlit as st
|
| 6 |
-
from pydantic import BaseModel, Field, SecretStr
|
| 7 |
-
|
| 8 |
-
import streamlit_pydantic as sp
|
| 9 |
-
from streamlit_pydantic.types import FileContent
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
class SelectionValue(str, Enum):
|
| 13 |
-
FOO = "foo"
|
| 14 |
-
BAR = "bar"
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
class OtherData(BaseModel):
|
| 18 |
-
text: str
|
| 19 |
-
integer: int
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
class ShowcaseModel(BaseModel):
|
| 23 |
-
short_text: str = Field(..., max_length=60, description="Short text property")
|
| 24 |
-
password: SecretStr = Field(..., description="Password text property")
|
| 25 |
-
long_text: str = Field(
|
| 26 |
-
..., format="multi-line", description="Unlimited text property"
|
| 27 |
-
)
|
| 28 |
-
integer_in_range: int = Field(
|
| 29 |
-
20,
|
| 30 |
-
ge=10,
|
| 31 |
-
le=30,
|
| 32 |
-
multiple_of=2,
|
| 33 |
-
description="Number property with a limited range. Optional because of default value.",
|
| 34 |
-
)
|
| 35 |
-
positive_integer: int = Field(
|
| 36 |
-
..., ge=0, multiple_of=10, description="Positive integer with step count of 10."
|
| 37 |
-
)
|
| 38 |
-
float_number: float = Field(0.001)
|
| 39 |
-
date: Optional[datetime.date] = Field(
|
| 40 |
-
datetime.date.today(),
|
| 41 |
-
description="Date property. Optional because of default value.",
|
| 42 |
-
)
|
| 43 |
-
time: Optional[datetime.time] = Field(
|
| 44 |
-
datetime.datetime.now().time(),
|
| 45 |
-
description="Time property. Optional because of default value.",
|
| 46 |
-
)
|
| 47 |
-
boolean: bool = Field(
|
| 48 |
-
False,
|
| 49 |
-
description="Boolean property. Optional because of default value.",
|
| 50 |
-
)
|
| 51 |
-
read_only_text: str = Field(
|
| 52 |
-
"Lorem ipsum dolor sit amet",
|
| 53 |
-
description="This is a ready only text.",
|
| 54 |
-
readOnly=True,
|
| 55 |
-
)
|
| 56 |
-
file_list: Optional[List[FileContent]] = Field(
|
| 57 |
-
None,
|
| 58 |
-
description="A list of files. Optional property.",
|
| 59 |
-
)
|
| 60 |
-
single_file: Optional[FileContent] = Field(
|
| 61 |
-
None,
|
| 62 |
-
description="A single file. Optional property.",
|
| 63 |
-
)
|
| 64 |
-
single_selection: SelectionValue = Field(
|
| 65 |
-
..., description="Only select a single item from a set."
|
| 66 |
-
)
|
| 67 |
-
single_selection_with_literal: Literal["foo", "bar"] = Field(
|
| 68 |
-
"foo", description="Only select a single item from a set."
|
| 69 |
-
)
|
| 70 |
-
multi_selection: Set[SelectionValue] = Field(
|
| 71 |
-
..., description="Allows multiple items from a set."
|
| 72 |
-
)
|
| 73 |
-
multi_selection_with_literal: Set[Literal["foo", "bar"]] = Field(
|
| 74 |
-
["foo", "bar"], description="Allows multiple items from a set."
|
| 75 |
-
)
|
| 76 |
-
single_object: OtherData = Field(
|
| 77 |
-
...,
|
| 78 |
-
description="Another object embedded into this model.",
|
| 79 |
-
)
|
| 80 |
-
string_list: List[str] = Field(
|
| 81 |
-
..., max_items=20, description="List of string values"
|
| 82 |
-
)
|
| 83 |
-
int_list: List[int] = Field(..., description="List of int values")
|
| 84 |
-
string_dict: Dict[str, str] = Field(
|
| 85 |
-
..., description="Dict property with string values"
|
| 86 |
-
)
|
| 87 |
-
float_dict: Dict[str, float] = Field(
|
| 88 |
-
..., description="Dict property with float values"
|
| 89 |
-
)
|
| 90 |
-
object_list: List[OtherData] = Field(
|
| 91 |
-
...,
|
| 92 |
-
description="A list of objects embedded into this model.",
|
| 93 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|