Spaces:
Sleeping
Sleeping
SpicyMelonYT
commited on
Commit
·
a4a6c55
1
Parent(s):
846bac8
using gradio textbox to string thing
Browse files
app.py
CHANGED
@@ -43,9 +43,9 @@ def respond(
|
|
43 |
yield response
|
44 |
|
45 |
|
46 |
-
def train_model():
|
47 |
-
print(
|
48 |
-
os.environ["HUGGINGFACE_TOKEN"] =
|
49 |
|
50 |
# Load dataset
|
51 |
dataset = load_dataset('json', data_files={
|
@@ -108,7 +108,7 @@ with demo:
|
|
108 |
train_button = gr.Button("Start Training")
|
109 |
train_output = gr.Textbox(label="Training Output")
|
110 |
|
111 |
-
train_button.click(train_model, outputs=train_output)
|
112 |
|
113 |
if __name__ == "__main__":
|
114 |
demo.launch()
|
|
|
43 |
yield response
|
44 |
|
45 |
|
46 |
+
def train_model(hf_token_value):
|
47 |
+
print(hf_token_value, flush=True)
|
48 |
+
os.environ["HUGGINGFACE_TOKEN"] = hf_token_value
|
49 |
|
50 |
# Load dataset
|
51 |
dataset = load_dataset('json', data_files={
|
|
|
108 |
train_button = gr.Button("Start Training")
|
109 |
train_output = gr.Textbox(label="Training Output")
|
110 |
|
111 |
+
train_button.click(train_model, inputs=hf_token, outputs=train_output)
|
112 |
|
113 |
if __name__ == "__main__":
|
114 |
demo.launch()
|