Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1610,24 +1610,6 @@ print("Transformer Output:", transformer_output)
|
|
1610 |
|
1611 |
|
1612 |
|
1613 |
-
def advanced_text_generation(input_vector):
|
1614 |
-
ff_output = nn.forward(input_vector)
|
1615 |
-
rnn_out = rnn.forward(input_vector)
|
1616 |
-
lstm_out = lstm.forward(input_vector)
|
1617 |
-
transformer_out = transformer.forward([input_vector])
|
1618 |
-
combined = [
|
1619 |
-
(ff_output[i] + rnn_out[i] + lstm_out[i] + transformer_out[i]) / 4
|
1620 |
-
for i in range(len(ff_output))
|
1621 |
-
]
|
1622 |
-
predicted_index = combined.index(max(combined))
|
1623 |
-
predicted_word = index_to_word[predicted_index]
|
1624 |
-
long_text = ""
|
1625 |
-
current_length = round(10 * PHI)
|
1626 |
-
for _ in range(5):
|
1627 |
-
segment = generate_text(current_length)
|
1628 |
-
long_text += segment + " "
|
1629 |
-
current_length = round(current_length * PHI)
|
1630 |
-
return long_text + predicted_word
|
1631 |
|
1632 |
|
1633 |
|
@@ -1644,52 +1626,6 @@ def advanced_text_generation(input_vector):
|
|
1644 |
|
1645 |
|
1646 |
|
1647 |
-
def chat():
|
1648 |
-
print("FiPhi-NeuralMark ACC Initialized")
|
1649 |
-
base_length = round(5 * PHI)
|
1650 |
-
while True:
|
1651 |
-
user_input = "input"
|
1652 |
-
if user_input.lower() == "exit":
|
1653 |
-
print("Goodbye!")
|
1654 |
-
break
|
1655 |
-
user_input_tokens = user_input.split()
|
1656 |
-
input_vector = [0] * len(unique_words)
|
1657 |
-
for word in user_input_tokens:
|
1658 |
-
if word in word_to_index:
|
1659 |
-
input_vector[word_to_index[word]] = 1
|
1660 |
-
response = advanced_text_generation(input_vector)
|
1661 |
-
print("FiPhi-NeuralMark: (ENCRYPTED)")
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
chat()
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
|
1694 |
|
1695 |
|
|
|
1610 |
|
1611 |
|
1612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1613 |
|
1614 |
|
1615 |
|
|
|
1626 |
|
1627 |
|
1628 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1629 |
|
1630 |
|
1631 |
|