Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion genc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
from genc.python import runtime
# pylint: enable=g-importing-member

del python # pylint: disable=undefined-variable
del python # pylint: disable=undefined-variable # pyrefly: ignore[unbound-name]
2 changes: 1 addition & 1 deletion genc/python/authoring/tracing_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def traced_computation(fn):
local=[
pb.Block.Local(name=k, value=v) for k, v in my_locals.items()
],
result=result,
result=result, # pyrefly: ignore[bad-argument-type]
)
)
portable_ir = constructor_bindings.create_lambda('arg', result)
Expand Down
6 changes: 3 additions & 3 deletions genc/python/examples/confidential_computing/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def main(argv: Sequence[str]) -> None:
# Computation to be executed in a secure enclave on Confidential Computing.
@genc.authoring.traced_computation
def foo(x):
prompt_template = genc.authoring.prompt_template["Tell me about {topic}"]
model_inference = genc.authoring.model_inference_with_config[{
prompt_template = genc.authoring.prompt_template["Tell me about {topic}"] # pyrefly: ignore[missing-attribute]
model_inference = genc.authoring.model_inference_with_config[{ # pyrefly: ignore[missing-attribute]
"model_uri": "/device/gemma",
"model_config": {"model_path": "/gemma-2b-it-q4_k_m.gguf"}}]
return model_inference(prompt_template(x))
Expand All @@ -46,7 +46,7 @@ def foo(x):
@genc.authoring.traced_computation
def bar(x):
backend = {"server_address": ADDRESS.value, "image_digest": DIGEST.value}
return genc.authoring.confidential_computation[foo, backend](x)
return genc.authoring.confidential_computation[foo, backend](x) # pyrefly: ignore[missing-attribute]

result = bar("scuba diving")
print(result)
Expand Down
1 change: 1 addition & 0 deletions genc/python/examples/openai_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def main(argv: Sequence[str]) -> None:

request = pb.Value()
request.str = (
# pyrefly: ignore[bad-assignment]
b'{"model": "gpt-3.5-turbo", "messages": [{"role": "user", "content":'
b' "Can you help me know things to do in San Fransisco"}]}'
)
Expand Down
6 changes: 3 additions & 3 deletions genc/python/interop/langchain/custom_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class CustomAgent(langchain.agents.agent.Agent):
"""The output parser to use in the agent."""

# Part of Langchain's Agent API.
allowed_tools: List[str] = None
allowed_tools: List[str] = None # pyrefly: ignore[bad-assignment]
"""The names of the tools that are allowed to be used."""

# List of tools to use with this Agent.
Expand Down Expand Up @@ -85,7 +85,7 @@ def _validate_tools(cls, tools: Sequence[Any]) -> None:
"""Validate that appropriate tools are passed in."""
pass

@pydantic_v1.root_validator()
def validate_prompt(cls, values: Dict[Any, Any]) -> Dict[Any, Any]: # pylint: disable=no-self-argument
@pydantic_v1.root_validator() # pyrefly: ignore[no-matching-overload]
def validate_prompt(cls, values: Dict[Any, Any]) -> Dict[Any, Any]: # pylint: disable=no-self-argument # pyrefly: ignore[bad-override]
"""Validate that prompt matches format."""
return values
Loading