KvrParaskevi
commited on
Commit
•
0de3a96
1
Parent(s):
3daead0
Update chatbot_bedrock.py
Browse files- chatbot_bedrock.py +10 -0
chatbot_bedrock.py
CHANGED
@@ -5,6 +5,16 @@ from langchain.chains import ConversationChain
|
|
5 |
import langchain.globals
|
6 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
7 |
import streamlit as st
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
class HuggingFaceModelWrapper(Runnable): # Assuming Runnable is the required interface
|
10 |
def __init__(self, model, tokenizer):
|
|
|
5 |
import langchain.globals
|
6 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
7 |
import streamlit as st
|
8 |
+
from abc import ABC, abstractmethod
|
9 |
+
|
10 |
+
class Runnable(ABC):
|
11 |
+
@abstractmethod
|
12 |
+
def run(self, input_text):
|
13 |
+
"""
|
14 |
+
This method should be implemented by any class that inherits from Runnable.
|
15 |
+
It should accept input text and return processed text or any other result based on the implementation.
|
16 |
+
"""
|
17 |
+
pass
|
18 |
|
19 |
class HuggingFaceModelWrapper(Runnable): # Assuming Runnable is the required interface
|
20 |
def __init__(self, model, tokenizer):
|