Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -13,10 +13,11 @@ basic_model_url = "https://huggingface.co/anshupatel4298/bert-chatbot-model/reso
|
|
13 |
local_model_path = "basic_chatbot_model.h5"
|
14 |
bert_model_name = "anshupatel4298/bert-chatbot-model/bert_model"
|
15 |
|
16 |
-
# Define the model architecture
|
17 |
def create_model():
|
18 |
model = tf.keras.Sequential([
|
19 |
-
tf.keras.layers.
|
|
|
20 |
tf.keras.layers.Dropout(0.5),
|
21 |
tf.keras.layers.Dense(64, activation='relu'),
|
22 |
tf.keras.layers.Dropout(0.5),
|
@@ -65,4 +66,3 @@ if st.button("Send"):
|
|
65 |
response = tf.argmax(outputs.logits, axis=-1).numpy()[0]
|
66 |
|
67 |
st.write(f"Bot: {response}")
|
68 |
-
|
|
|
13 |
local_model_path = "basic_chatbot_model.h5"
|
14 |
bert_model_name = "anshupatel4298/bert-chatbot-model/bert_model"
|
15 |
|
16 |
+
# Define the model architecture that matches the original one
|
17 |
def create_model():
|
18 |
model = tf.keras.Sequential([
|
19 |
+
tf.keras.layers.InputLayer(input_shape=(1825,)), # Adjust input shape to match the original model
|
20 |
+
tf.keras.layers.Dense(128, activation='relu'),
|
21 |
tf.keras.layers.Dropout(0.5),
|
22 |
tf.keras.layers.Dense(64, activation='relu'),
|
23 |
tf.keras.layers.Dropout(0.5),
|
|
|
66 |
response = tf.argmax(outputs.logits, axis=-1).numpy()[0]
|
67 |
|
68 |
st.write(f"Bot: {response}")
|
|