Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -8,7 +8,7 @@ import gradio as gr
|
|
8 |
import torch
|
9 |
import torch.nn as nn
|
10 |
import torch.optim as optim
|
11 |
-
from torch.utils.data import DataLoader,
|
12 |
from sklearn.ensemble import IsolationForest, RandomForestClassifier
|
13 |
from sklearn.model_selection import train_test_split
|
14 |
from sklearn.preprocessing import OneHotEncoder
|
@@ -181,8 +181,7 @@ def evolve_emotions():
|
|
181 |
toolbox.register("individual", tools.initCycle, creator.Individual,
|
182 |
(toolbox.attr_float,) * (len(emotions) - 1) +
|
183 |
(toolbox.attr_intensity,) * len(emotions) +
|
184 |
-
(lambda:
|
185 |
-
n=1)
|
186 |
toolbox.register("population", tools.initRepeat, list, toolbox.individual)
|
187 |
toolbox.register("mate", tools.cxTwoPoint)
|
188 |
toolbox.register("mutate", tools.mutGaussian, mu=0, sigma=1, indpb=0.2)
|
@@ -237,9 +236,9 @@ iface = gr.Interface(
|
|
237 |
fn=process_input,
|
238 |
inputs="text",
|
239 |
outputs=[
|
240 |
-
gr.
|
241 |
-
gr.
|
242 |
-
gr.
|
243 |
],
|
244 |
live=True
|
245 |
)
|
|
|
8 |
import torch
|
9 |
import torch.nn as nn
|
10 |
import torch.optim as optim
|
11 |
+
from torch.utils.data import DataLoader, IterableDataset
|
12 |
from sklearn.ensemble import IsolationForest, RandomForestClassifier
|
13 |
from sklearn.model_selection import train_test_split
|
14 |
from sklearn.preprocessing import OneHotEncoder
|
|
|
181 |
toolbox.register("individual", tools.initCycle, creator.Individual,
|
182 |
(toolbox.attr_float,) * (len(emotions) - 1) +
|
183 |
(toolbox.attr_intensity,) * len(emotions) +
|
184 |
+
(lambda: 100,), n=1)
|
|
|
185 |
toolbox.register("population", tools.initRepeat, list, toolbox.individual)
|
186 |
toolbox.register("mate", tools.cxTwoPoint)
|
187 |
toolbox.register("mutate", tools.mutGaussian, mu=0, sigma=1, indpb=0.2)
|
|
|
236 |
fn=process_input,
|
237 |
inputs="text",
|
238 |
outputs=[
|
239 |
+
gr.Textbox(label="Emotional Response"),
|
240 |
+
gr.Textbox(label="Sentiment Response"),
|
241 |
+
gr.Textbox(label="Generated Text")
|
242 |
],
|
243 |
live=True
|
244 |
)
|