MCPcopy
hub / github.com/fauxpilot/fauxpilot / trim_with_stopwords

Method trim_with_stopwords

copilot_proxy/utils/codegen.py:35–40  ·  view source on GitHub ↗
(output: str, stopwords: list)

Source from the content-addressed store, hash-verified

33
34 @staticmethod
35 def trim_with_stopwords(output: str, stopwords: list) -> str:
36 for w in sorted(stopwords, key=len, reverse=True):
37 if output.endswith(w):
38 output = output[:-len(w)]
39 break
40 return output
41
42 @staticmethod
43 def to_word_list_format(word_dict, tokenizer):

Callers 1

generateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected