Skip to content

Commit

Permalink
mcli
Browse files Browse the repository at this point in the history
  • Loading branch information
KuuCi committed Aug 9, 2023
1 parent 9549c76 commit ce6915e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions examples/end-to-end-examples/support_chatbot/chatbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@
from langchain.chains import RetrievalQAWithSourcesChain, LLMChain, RetrievalQA
from langchain.chains.combine_documents.stuff import StuffDocumentsChain
from langchain.schema import Document

from .scripts.repo_downloader import RepoDownloader
import sys

ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(ROOT_DIR))

from repo_downloader import RepoDownloader

__all__ = ['ChatBot']

Expand Down Expand Up @@ -378,13 +380,13 @@ def chat(self,
"""

if query == "!eval_7b":
self.set_eval_state(endpoint_url='https://chatbot-7b-finetuned-0grh76.inf.hosted-on.mosaicml.hosting/predict')
self.set_eval_state(endpoint_url='https://chatbot-7b-finetuned-lo1t1e.inf.hosted-on.mosaicml.hosting/predict')
score = self.evaluate_simple(EVAL_SIMPLE_DIR, EVAL_7B_TEMPLATE)
self.reload_chat_state()
print(score)
return score
elif query == "!eval_7b_complex":
self.model.endpoint_url = 'https://chatbot-7b-finetuned-0grh76.inf.hosted-on.mosaicml.hosting/predict'
self.model.endpoint_url = 'https://chatbot-7b-finetuned-lo1t1e.inf.hosted-on.mosaicml.hosting/predict'
out = self.evaluate_complex(EVAL_COMPLEX_DIR, EVAL_7B_TEMPLATE)
self.model.endpoint_url = self.saved_state['endpoint_url']
return out
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ command: |
pip install composer[streaming,libcloud,oci]==0.14.1
pip install packaging==23.1
pip install langchain==0.0.205
pip install gitpython
model:
backend: faster_transformers
Expand Down

0 comments on commit ce6915e

Please sign in to comment.