Spaces:
Runtime error
Runtime error
Commit
·
1c365c7
1
Parent(s):
8b1ae76
update in llms
Browse files
app.py
CHANGED
@@ -69,7 +69,10 @@ from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
|
69 |
|
70 |
from langchain.llms.base import LLM
|
71 |
from langchain.callbacks.manager import CallbackManagerForLLMRun
|
72 |
-
|
|
|
|
|
|
|
73 |
|
74 |
class GPTRemote(LLM):
|
75 |
n: int
|
@@ -94,6 +97,17 @@ class GPTRemote(LLM):
|
|
94 |
@property
|
95 |
def _identifying_params(self) -> Mapping[str, Any]:
|
96 |
return [("n", self.n)]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
|
98 |
GPTfake = GPTRemote(n=0)
|
99 |
|
|
|
69 |
|
70 |
from langchain.llms.base import LLM
|
71 |
from langchain.callbacks.manager import CallbackManagerForLLMRun
|
72 |
+
from langchain.schema import (
|
73 |
+
Generation,
|
74 |
+
LLMResult
|
75 |
+
)
|
76 |
|
77 |
class GPTRemote(LLM):
|
78 |
n: int
|
|
|
97 |
@property
|
98 |
def _identifying_params(self) -> Mapping[str, Any]:
|
99 |
return [("n", self.n)]
|
100 |
+
|
101 |
+
def _generate(
|
102 |
+
self,
|
103 |
+
prompts: List[str],
|
104 |
+
stop: Optional[List[str]] = None,
|
105 |
+
run_manager: Optional[CallbackManagerForLLMRun] = None,
|
106 |
+
**kwargs: Any,
|
107 |
+
) -> LLMResult:
|
108 |
+
|
109 |
+
return LLMResult(generations=[Generation("test result")])
|
110 |
+
"""Run the LLM on the given prompts."""
|
111 |
|
112 |
GPTfake = GPTRemote(n=0)
|
113 |
|