PayPeer commited on
Commit
f5eaae9
·
1 Parent(s): c4cd084

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -40,6 +40,11 @@ class GradioLLM(Runnable):
40
  super().__init__() # Call the constructor of Runnable if necessary
41
  self.client = Client(client_url)
42
 
 
 
 
 
 
43
  def generate(self, prompt, **kwargs):
44
  # Assuming the API expects 'prompt' and 'system_prompt' as inputs
45
  result = self.client.predict(prompt, prompt, api_name="/predict")
 
40
  super().__init__() # Call the constructor of Runnable if necessary
41
  self.client = Client(client_url)
42
 
43
+ def invoke(self, prompt, **kwargs):
44
+ # Implement the invoke method here
45
+ result = self.client.predict(prompt, prompt, api_name="/predict")
46
+ return result['data'][0] # Adjust based on the actual response format
47
+
48
  def generate(self, prompt, **kwargs):
49
  # Assuming the API expects 'prompt' and 'system_prompt' as inputs
50
  result = self.client.predict(prompt, prompt, api_name="/predict")