Spaces:
Running
Running
Commit
·
63e3e29
1
Parent(s):
8d0a18a
updated Csv and auth
Browse files- app.py +5 -6
- uw_programmatic/uw_machine.py +2 -1
app.py
CHANGED
@@ -122,16 +122,15 @@ with gr.Blocks() as demo:
|
|
122 |
fn=run_with_context(questions_downloaded),
|
123 |
outputs=[start_button]
|
124 |
)
|
125 |
-
# username = os.getenv('HF_USERNAME','')
|
126 |
-
# password = os.getenv('HF_PASSWORD','')
|
127 |
# if username != '' and password != '':
|
128 |
# demo.launch(auth=(username,password))
|
129 |
# else:
|
130 |
# with gr.Blocks() as failed:
|
131 |
# gr.Markdown("Environment Error - No username and password provided")
|
132 |
# failed.launch()
|
133 |
-
run_with_context(load_dotenv)
|
|
|
134 |
demo.launch(
|
135 |
-
|
136 |
-
server_name="0.0.0.0",
|
137 |
-
auth=(os.environ.get('HF_USERNAME','test1'),os.environ.get('HF_PASSWORD','test1password')))
|
|
|
122 |
fn=run_with_context(questions_downloaded),
|
123 |
outputs=[start_button]
|
124 |
)
|
125 |
+
# username = os.getenv('HF_USERNAME','') os.environ.get('HF_USERNAME','test1')
|
126 |
+
# password = os.getenv('HF_PASSWORD','')
|
127 |
# if username != '' and password != '':
|
128 |
# demo.launch(auth=(username,password))
|
129 |
# else:
|
130 |
# with gr.Blocks() as failed:
|
131 |
# gr.Markdown("Environment Error - No username and password provided")
|
132 |
# failed.launch()
|
133 |
+
#run_with_context(load_dotenv)
|
134 |
+
load_dotenv()
|
135 |
demo.launch(
|
136 |
+
auth=(os.environ.get('HF_USERNAME','test1'),os.environ.get('HF_PASSWORD','test1')))
|
|
|
|
uw_programmatic/uw_machine.py
CHANGED
@@ -164,7 +164,8 @@ class UWMachine(UWBaseMachine):
|
|
164 |
writer = csv.writer(file)
|
165 |
for question in range(len(self.question_list)):
|
166 |
# TODO: Shuffle answers according to row, keep correct answer in random section. Answer column is a number.
|
167 |
-
new_row = [
|
|
|
168 |
wrong_answers = list(self.question_list[question]["Wrong Answers"])
|
169 |
column = random.randint(1, len(wrong_answers) + 1)
|
170 |
new_row.append(column)
|
|
|
164 |
writer = csv.writer(file)
|
165 |
for question in range(len(self.question_list)):
|
166 |
# TODO: Shuffle answers according to row, keep correct answer in random section. Answer column is a number.
|
167 |
+
new_row = ["MC", "", 1]
|
168 |
+
new_row.append(self.question_list[question]["Question"])
|
169 |
wrong_answers = list(self.question_list[question]["Wrong Answers"])
|
170 |
column = random.randint(1, len(wrong_answers) + 1)
|
171 |
new_row.append(column)
|