PayPeer commited on
Commit
b057d48
·
1 Parent(s): d1aed6b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -9,7 +9,8 @@ from langchain.chains import ConversationChain
9
  from langchain.chains.conversation.memory import ConversationBufferWindowMemory
10
  import os
11
 
12
- from langchain.llms import Runnable
 
13
 
14
 
15
  # Access environment variables
@@ -33,7 +34,8 @@ def gradio_client_interaction(prompt):
33
  result = client.predict(prompt, prompt, api_name="/predict")
34
  return result['data'][0] # Assuming the response format
35
 
36
- class GradioLLM(Runnable):
 
37
  def __init__(self, client_url):
38
  super().__init__() # Call the constructor of Runnable if necessary
39
  self.client = Client(client_url)
 
9
  from langchain.chains.conversation.memory import ConversationBufferWindowMemory
10
  import os
11
 
12
+ # from langchain.llms import Runnable
13
+ from langchain.llms import HuggingFaceInference
14
 
15
 
16
  # Access environment variables
 
34
  result = client.predict(prompt, prompt, api_name="/predict")
35
  return result['data'][0] # Assuming the response format
36
 
37
+ # class GradioLLM(Runnable):
38
+ class GradioLLM(HuggingFaceInference):
39
  def __init__(self, client_url):
40
  super().__init__() # Call the constructor of Runnable if necessary
41
  self.client = Client(client_url)